The leaves are turning, the air is crisp, and something pumpkin-spiced is calling your name. But you can’t think about all that fall fun right now because you’re too busy troubleshooting your Splunk instance. We know that feeling, and that’s one of the reasons we frequently post hints and tips in this blog.
With that in mind, we thought it would be helpful to reveal our most popular and common tactics for Splunk troubleshooting and finding solutions to give you that little nudge you need to get back on track.
David Allen, a Senior Certified Splunk Consultant here at TekStream, starts us off with tips you can use to go from a novice to an expert. Read how the Search Job Inspector tool shows you where your Splunk system has been searching for issues, and how much time it’s been looking there. Dig into Execution Costs, Search Job Properties, and the BTOOL CLI command that reveals the actual settings on your SSD. These are standard functions that come with Splunk Enterprise software. You can rely on David’s problem-solving expertise as you dig into these issues and are invited to reach out if you have other questions.
Going next level on the BTOOL utility, this popular post stresses that BTOOL is not a reflection of memory, but of what is written on your disk or your SSD. This tutorial walks you through the recommended steps for a Linux environment. Windows tutorials are available – just ask!
We end our roundup with a tidy list of three issues from Senior Splunk Consultant Aaron Dobrzeniecki. Data Quality, Search Performance, and High Resource Usage should be the first line of defense in your Splunk installation. You’ll see strategy and implementation advice with an eye to inspection. If you want more details, Aaron can be reached using the request at the end of the page.
That should fix those issues – now you’re ready to go out there and “pumpkin-spice up” your fall!
What other issues have you encountered in your Splunk environment? Check out other Splunk info and contact us for additional support.
Splunk Connect for Syslog (SC4S) is a containerized version of syslog-ng that has out-of-the-box configurations for many known Sources, and it’s also supported by Splunk. The implementation is different than a classic syslog-ng install that is typically installed on a host which receives syslog traffic and then it writes out logs to a filesystem to then be picked up by a Splunk Universal Forwarder and then sent to a Splunk indexing tier. SC4S uses HTTP Event Collector (HEC) to send events directly to the receiving Splunk instance without the need to write the logs to disk. We help customers with issues when configuring Splunk Connect for syslog (SC4S) implementations and have noticed a few common areas where missteps can occur.
Here are the top 4 issues when configuring Splunk Connect for syslog:
1. Read through the entire set of docs
2. Decide if you’ll use out-of-the-box indexes
3. Important HEC token settings
4. What to do if your Source isn’t listed
1. Read the docs
The most common issue that I see is that users don’t read the docs that are available before attempting to install and configure SC4S. There is a ton of great information out there. Sometimes it takes a few passes through the docs to understand various concepts, but the developers have done a great job of getting excellent material out there. Nearly 10/10 times when I’m helping a customer this is the first place I’ll check to see (or confirm) that the necessary configs are spelled out well. There are document sections for based configurations (for various container flavors), quick start guides, all the OOTB sources, troubleshooting, FAQ and much more.
Check out the docs here and make sure that you select the version that you are currently using:
SC4S is pre-configured to map each sourcetype to a typical index. For new installations, it is best practice to create the indexes in Splunk when using the SC4S defaults. SC4S can be easily customized to use different indexes if desired.
When you decide to use custom indexes or maybe you’ve already been adding data to custom indexes prior to implementing SC4S, you can easily override the default index values for the source by editing a configuration file called splunk_metadata.csv which contains a mapping using the key value for a source and then specifies what metadata field to overwrite, index in this case and then the value for index. Here is a typical example entry below.
juniper_netscreen,index,ns_index
See the configuration pages (in the docs that you’re supposed to read) here:
It is very important that you understand the configuration choices that you make when creating your HEC token on the Splunk receiving instance. There is a lot of info in the docs regarding endpoints and loadbalancer settings but the settings that are most often set incorrectly are for the indexes. Ensure the token has access to place events in main, em_metrics, and all indexes used as event destinations.
NOTE: It is recommended that the “Selected Indexes” on the token configuration page be left blank so that the token has access to all indexes, including the lastChanceIndex. If this list is populated, extreme care must be taken to keep it up to date, as an attempt to send data to an index not in this list will result in a 400 error from the HEC endpoint. Furthermore, the lastChanceIndex will not be consulted in the event the index specified in the event is not configured on Splunk. Keep in mind just one bad message will “taint” the whole batch (by default 1000 events) and prevent the entire batch from being sent to Splunk.
SC4S comes pre-configured to support over 50 different Vendors and many more Sources including data formats such as CEF and LEEF. You can refer to the docs to check if the Source you want to onboard is already included, however if it’s not, you can simply head over to the GitHub project for SC4S and create a new “Issue” and provide a redacted packet capture (PCAP) of the source as well as any information that you have about the Vendor and then Splunk will develop the appropriate parser for the Source and include it in the next release. This process not only helps you, but it also potentially helps other customers that may want to onboard that Source as well.
SC4S can be a very straightforward and simple way to implement syslog data collection. If you can follow these guidelines and avoid the gotchas you won’t have any issues when configuring Splunk Connect for syslog.
If you have any additional needs or questions please contact TekStream and we’d be happy to assist you.
Your analysts should spend more time doing analysis and investigation. Our Splunk SOAR (Cloud) Phishing playbook template walkthrough offers a visual platform for generating a playbook without writing code, so you can automate security procedures.
Below is a picture of the top-level phishing playbook template. I used comment blocks to note what should happen where in the playbook because playbook blocks require an existing playbook to name them and don’t allow notes. It is intended to give guidance on the process flow. Making templates for the sub-playbooks is largely unnecessary since those can vary between customers, and most are simple linear playbooks. I will cover the playbook going top to bottom.
Email Extraction:
Extract block for email file. This could change depending on how the phishing emails are being sent to Phantom. Extract IOC is a common method of parsing. The output will be various artifacts, for example, Email, URL, and Domain. Use extract IOC for .eml files.
Precheck:
Check email against a list of checks for whitelisting and blacklisting. This will save time and resources. Use custom lists to store whitelisted and blacklisted values like domains and IP addresses. Many internal emails can be whitelisted this way, especially if users are the ones flagging phishing emails.
Whitelisted:
Build a sub-playbook to process whitelisted events. It can perform many actions, including sending a notification email to the submitter or ticket creation coupled with immediate closure for record keeping. Talk to the customer about what they want to do.
Blacklisted:
Add a sub-playbook here to process blacklisted emails. Example actions to run: notification emails, ticket creation, isolation/triage. Talk to the customer about what they want to be done here.
Other:
Below, the playbook will branch out into multiple sub-playbooks to evaluate whichever items the consultant or customer deems helpful in determining the risk score of the email. They are broken up to maintain the readability of the top-level playbook while giving a detailed view of how the process works. A ticket in a 3rd party system like ServiceNow or JIRA can be opened here to record operations runs and their results (if the customer uses such a service). Don’t put all these sub-playbooks into a single playbook; that would be less readable and could result in one small part of the playbook interfering with more parts. Isolate them to improve readability and make maintenance easier.
Domain Evaluation:
Evaluate the domain artifacts created by using extract IOC. Discuss with the customer what API they will use to perform these checks. I recommend steering them toward any API that has an app on Phantom.
If the API they choose doesn’t have an app, then the consultant will have to code the API call themselves. Not only is this time-consuming, but once the consultant rolls off the project, someone else will have to maintain that code. The customer will likely not have control over the changes made to the API, so if the API changes, whoever maintains the code will have to edit it. Phantom apps are maintained by Splunk or the API developer, so the customer won’t have to do much maintenance.
URL Evaluation:
Evaluate URL artifacts in a sub-playbook by sending the URLs as inputs. Again, try to use an API with an existing Phantom app. If the API doesn’t have an entry for the URL, a submission should be run. Waiting for this submission to be finished will take time (5-15 min), so it would be better to just submit it in the playbook and have a manual review check for the score later when it’s done processing. Otherwise, custom code will have to be run to wait for the results, which will stall the whole playbook and could cause a backlog of emails.
IP Evaluation:
Evaluate the IP address of the email sender. When parsing .eml files with extract IOC, the IP address can be found in the Authentication-Results field in the email artifact. An ipv4 extract block can get the IP address without custom code. Customers might want multiple kinds of data to be evaluated here, like geolocation and reputation. Splunk has its own app for IP geolocation, which gives different fields for latitude, longitude, city, state, country, address, etc. A custom list will come in handy to whitelist/blacklist locations.
File Evaluation:
Use a sub-playbook to evaluate and/or detonate any attached files. Ignore image files since they won’t run anything and will be too common to process them all. Search for pre-existing entries using the hash included in the vault artifact corresponding to the file. If there isn’t an existing entry, submit the file; similar to the URL submissions, it is better to have the manual review check the score after the submission is done processing.
Score Assessment:
Using results from the branching eval playbooks, determine an overall score or a group of scores to be evaluated against thresholds in the following decision block. Example methodologies: weighted average, highest, weighted average of highest values. Use custom lists for weights.
Post check:
Evaluate the risk of the email by comparing it to thresholds inputted into this block. There are many different options to go with, but it will probably be best to start with low thresholds and increase them depending on volume and accuracy.
Safe:
Use another sub-playbook for processing emails determined to be safe. Example actions: send notification emails, open/close tickets, etc. Discuss these actions with the client.
Dangerous:
Use another sub-playbook for processing emails determined to be dangerous. Example actions: send notification emails, open/close tickets, etc. Discuss these actions with the client.
Want to learn more about creating a phishing playbook template in Splunk SOAR (Cloud)? Contact us today!
Splunk is a very powerful tool that allows you to transform your data and parse it the way you want to in most cases. Using some basic Splunk functionality, you can route data to multiple destinations, may it be multiple indexes, indexers, or even other destinations. This can help you address different scenarios where you may want to have data from a single source go to multiple destinations.While there can be many use cases you can address with this, we will touch upon a few use-cases that I have come across during my years of work with Splunk.
•Route data to multiple destinations from a Splunk Universal/Heavy Forwarder using inputs.conf
•Route data to multiple destinations using props/transforms
Route Data to multiple destinations from Splunk UF/HF using inputs.conf
There can be multiple use-cases where you would want to use inputs.conf to route your data to multiple destinations. Some of the most common use-cases I’ve seen are
•Customers need to send data to other external tools outside of Splunk.
•Customers in a hybrid cloud/on-prem environment needed to send the same data to Splunk Cloud indexers and their Splunk on-prem (Enterprise) indexers
Before we dive deeper into this, if you are sending data externally outside of Splunk over Syslog, in Splunk you will need a Splunk Heavy Forwarder (HF). You can route data from multiple UFs to a single HF that can send data over Syslog to an external source.On the universal forwarder, you can set multiple output destinations using multiple target groups. These can include the following;
•TCP 9997 to Splunk servers
•TCP to non-Splunk servers using the “sendCookedData=false” setting
Splunk Heavy Forwarders can also send Syslog data to third-party systems over TCP and UDP protocols. If your third-party system accepts data over Syslog then you can route data from your UFs to HFs and further to the Syslog endpoint.
Routing data using inputs.conf on a Universal Forwarder
You can create multiple target groups in the outputs.conf
Universal Forwarder
##outputs.conf[tcpout]
defaultGroup = splunk-target-indexers[tcpout:splunk-target-indexers]
server = x.x.x.x:9997[tcpout:non-splunk-target-group]
server = x.x.x.x:port
sendCookedData = false[tcpout:splunk-heavy-forwarder]
server = x.x.x.x:9997
A universal forwarder will route data to the default group if you do not specify a different destination using the _TCP_ROUTING attribute for your input.
##inputs.conf# This will route to default group
[monitor:///var/log/abc.log]
index = os_nix
sourcetype = abc-log# This will route to splunk-target-indexers and non-splunk-target-group
[monitor:///var/log/def.log]
index = os_nix
sourcetype = def-log
_TCP_ROUTING = splunk-target-group,non-splunk-target-group
Routing and filtering data on the Heavy Forwarder
You can use the heavy forwarder to do advanced routing and filtering. You can send data out of Splunk using the Syslog server and also use props and transforms to route a subset of data to certain destinations.##outputs.conf[tcpout]
defaultGroup = splunk-target-group[tcpout:splunk-target-group]
server = x.x.x.x:9997[tcpout:non-splunk-target-group]
server = x.x.x.x:port
sendCookedData = false[syslog]
defaultGroup = syslogGroup[syslog:syslogGroup]
server = ipddress:port OR hostname:port
type = udp|tcp
Route data to Syslog
In the example, we will see how a subset of events are routed to Syslog##transforms.conf#Create a transform to route data
[send-to-syslog]
REGEX = . #This will capture all events, you can write a regex to capture specific events
DEST_KEY = _SYSLOG_ROUTING
FORMAT = syslogGroup##props.conf#Route data from a specific host to syslog
[host::somehost*]
TRANSFORMS-syslog_output = send_to_syslog#Route a specific sourcetype to syslog
[sourcetype::some-sourcetype]
TRANSFORMS-syslog_out = send_to_syslogSplunk transforms are very powerful and allow you to transform, filter and route your data in multiple ways. To learn more about what transforms can do, you can review the documentationhere.
If you have Splunk routing or data filtering questions, please contact Zubair and our Splunk developer team for more info:
Whether you want to get an app approved or create a new sourcetype in Splunk Cloud, the cloud vetting process can be an exhausting exercise in vetting involving you and the cloud ops team. This post will show you how to leverage the Splunk App Inspect API, as well as common pitfalls to avoid so that your app gets approved for installation.
From an on-prem Splunk instance access the Splunk GUI to create a new app on your instance. Set a name, folder name, set visibility to “No”, and the template to barebones.
Access the CLI of the machine you did this on through SSH or locally. Navigate into the directory where the template app was created; $SPLUNK_HOME/etc/apps.
This directory will be the template for creating the app. It is easier to start from this template as it will have the necessary default files and a structure to start from.
In this example we are looking to create a custom app that will modify a sourcetype in a Splunk Cloud deployment.
To figure out what props.conf changes need to be made for the sourcetype; Get the raw data you are trying to parse. Upload data through the “Add Data” section in Splunk. Select a source and drop in the data file. Now you can create a custom sourcetype.
Go to “Advanced” and enter the appropriate fields to correctly parse your sourcetype. These can be new settings for; time_prefix, max_timestamp_lookade, time_format, etc.
Save the setting and check if the parsing is working as you want it. Hit “preview” to see the necessarily props.conf settings.
Example of resulting props.conf stanza:
[new_sourcetype_dreamcrush] SHOULD_LINEMERGE=false LINE_BREAKER=</Interceptor>([rn]+) NO_BINARY_CHECK=true CHARSET=UTF-8 disabled=false TIME_FORMAT=%Y-%m-%d</ActionDate> TIME_PREFIX=<ActionDate> Go back to the machine with the app template directory.
If a props.conf needs to be created, create, and set it to the proper permissions for Splunk custom apps (700 for directories and 600 for files). Append the setting you created to the $SPLUNK_HOME/etc/apps/appname/props.conf of your app.
Commands cd $SPLUNK_HOME/etc/apps/appname/ touch props.conf chmod 600 props.conf vi props.conf
If this is a one-time custom app, such for creating a sourcetype, add the following stanza to the $SPLUNK_HOME/etc/apps/appname/app.conf.
[package]
check_for_updates = 0
Next, there should only be a default directory in the custom app. If you are modifying an app through the GUI however, it will create files in the local directory. Make sure you move the necessary files and merge the configs in the default directory. NOTE: You should also remove the bin directory, which would be where you place scripts, if it is not needed.
Commands cd $SPLUNK_HOME/etc/apps/appname/ rm -rf local rm -rf bin
As bare minimums, you only need the default and metadata directories. Make sure the parent app directory has “execute” permissions.
The following commands will set all the files’ permissions to 600 and all directories’ permissions to 700 – the standard for Splunk custom apps. Run this inside the root folder of your app ($SPLUNK_HOME/etc/apps/appname/). You can replace “/path/to/base/dir” with a period “.” to get every file/directory in and under the working directory.
Commands find /path/to/base/dir -type d -exec chmod 700 {} + find /path/to/base/dir -type f -exec chmod 600 {} +
You can then compress the directory into an archive using a command such as tar. This is packaging the app.
NOTE: On a MacOS machine, there are temporary files created that will be denied by the cloud vetting process. To avoid this, a variable to not copy the temporary files (dot_underscore) must be set followed by the appropriate flag in the tar command.
Commands export COPYFILE_DISABLE=1 tar –exclude=”.*” -czvf test_template.tar test_template
Under your workspaces on the left you will see the AppInspect – Production collection.
You can then run the Authenticate script supplying your Splunk login and password to get an authorization token.
Depending on the type of validation you need, you can then use one of the “script” POST scripts to submit your app tar by selecting the app_package KEY.
You can then use the “status” GET script to generate the results of the validation based on the app you submitted. Finally, you will use the “report” GET scripts to grab the report results in either HTML or JSON format. This report will tell you if your app would pass the vetting process if you were to submit it through Splunk Customer as an app install, for example. Issues that will block the app are listed as failures and issues that should be fixed put wouldn’t cause a block are listed as warnings.
If you followed the steps in this article. You will see that there are no failures, and this custom app would pass the cloud vetting.
There is, however, 1 warning;
check_kos_are_accessible
• The ‘admin’ role is not available to Splunk Cloud customers. Please consider also including the ‘sc_admin’ role if you want Splunk Cloud customer administrators to be able to access this knowledge object File: default.meta Line Number: 5
To change all the occurences of “admin” to “sc_admin” in the default.meta file use the following commands.
Commands cd $SPLUNK_HOME/metadata vi default.meta :%s/admin/sc_admin :wq
After making this change, if you compress the file and resubmit it through the Splunk AppInspect checks, it will have no failures/warnings.
This custom app can then be submitted to be implemented in your Splunk Cloud environment without any issues!
• Splunk App packages must contain a `default/app.conf file`. No `default/app.conf` was found in `[redacted]`.
An app.conf file must be created. Using a template from a barebones app from Splunk will do this but if one already exists in your local directory;
Commands cd $splunkhome/etc/apps/appname/local mv app.conf ../default/app.conf
2. check_that_local_does_not_exist
• A 'local' directory exists in the app.
You need to move all the files from local into default. You can either merge the two if both are populated or remove the default directory and rename the local one.
Commands rm -r default mv local default
3. check_for_bin_files
• This file has execute permissions for owners, groups, or others. File: local/data/ui/views/[redacted].xml
You need to change all fields to have 600 permissions and all directories to have 700 permissions.
Commands find /path/to/base/dir -type d -exec chmod 700 {} + find /path/to/base/dir -type f -exec chmod 600 {} +
4.
check_simplexml_standards_version
• Change the version attribute in the root node of your Simple XML dashboard local/data/ui/views/[redacted].xml to `<version=1.1>`. Earlier dashboard versions introduce security vulnerabilities into your apps and are not permitted in Splunk Cloud File: local/data/ui/views/[redacted].xml
In all your dashboards, the Splunk standard is to have it with <dashboard> or <form>.
Example Old: <?xml encoding=”UTF-8″?><version=”1.1″><form theme=”light”>
New: <form theme=”light” version=”1.1″>
5. check_for_sched_saved_searches_earliest_time
The saved search [redacted] doesn't contain dispatch.earliest_time.It is prohibited to specify scheduled searches that don't specify a dispatch.earliest_time in Splunk Cloud. File: default/savedsearches.conf Line Number: 165
All saved searches must have an earliest time. If a search is set to All-Time in the GUI. It will normally have a latest_time of “now()” and no earliest_time defined. You can fix this by going to the $SPLUNK_HOME/etc/apps/appname/default/savedsearches.conf and adding “dispatch.earliest_time = 1” under the appropriate search stanzas. This will set the start time at the start of unix time.
6. check_for_valid_package_id
• The app.conf [package] stanza's has an invalide 'id' property: [redacted]. For the `id` property, it must contain only letters, numbers, `.` (dot), and `_` (underscore) characters, and can not endwith a dot character. Besides, some reserved names are prohibited. See https://docs.splunk.com/Documentation/Splunk/7.3.1/Admin/Appconf for details. File: default/app.conf Line Number: 6
check_that_directory_name_matches_package_id
• The `app.conf` [package] stanza has an `id` property that does not match the uncompressed directory's name. `app.conf` [package] id: [redacted] uncompressed directory name: [redacted]. File: default/app.conf Line Number: 6
In the $SPLUNK_HOME/etc/apps/appname/default/app.conf there is an id property under the [package] stanza. This has to exactly match the filename of the UNCOMPRESSED app package. It can also only contain letters, numbers, dot and underscore.
Example Old: [package] id = Test® Template™ BETA New: [package] id = TestTemplate You would also have to rename the directory to match the id;
Commands mv TestTemplateBETA TestTemplate
7. check_for_local_meta
• Do not supply a local.meta file- put all settings in default.meta. File: metadata/local.meta
There should be no local.meta file. If there is one and it is populated, you should merge the local.meta into the default.meta. Make sure that you aren’t making changes to the app while you are packaging it, or a new local.meta file will be created.
In stanza [redact]_initial_index, property coldPath should be $SPLUNK_DB/somedata_index/colddb, but is $SPLUNK_DBsomedata_indexcolddb here. File: default/indexes.conf Line Number: 3
Illegal property maxTotalDataSizeMB found in stanza somedata_index. Only properties [homePath, coldPath, thawedPath, frozenTimePeriodInSecs, disabled, datatype, repFactor] are allowed in default/indexes.conf. File: default/indexes.conf Line Number: 15
The file indexes.conf must have certain properties and must be written with forward slashes (/).
The saved search [redacted] doesn't contain dispatch.latest_time.It is better to add a dispatch.latest_time when specifying scheduled searches in Splunk Cloud. File: default/savedsearches.conf Line Number: 165
All saved searches should have a latest time. If a search is set to All-Time in the GUI. You can fix this by going to the $SPLUNK_HOME/etc/apps/appname/default/savedsearches.conf and adding “dispatch.latest_time = now()” (or whatever appropriate time frame) under the appropriate search stanzas.
10. check_kos_are_accessible
In Splunk Cloud, customers have access to the sc_admin role instead of the admin role. Your customers will not be able to access knowledge objects where the only assigned role is admin. Please consider also including the sc_admin role for compatibility with Splunk Cloud. File: local.meta Line Number: 342
To fix this you must go into the appropriate file (default.meta in this case) and replace all instances of “admin” to “sc_admin” for the Splunk Cloud users.
Commands cd $SPLUNK_HOME/etc/apps/appname/medata vi default.meta :%s/admin/sc_admin :wq
A prohibited file or directory was found in the extracted Splunk App: default/data/ui/views/._[redacted].xml
NOTE: On a MacOS machine, there are temporary files created that will be denied by the cloud vetting process. To avoid this, a variable to not copy the temporary files (dot_underscore) must be set followed by the appropriate flag in the tar command.
Commands export COPYFILE_DISABLE=1 tar –exclude=”.*” -czvf appname.tar appname
Learn how TekStream can guide you through the complexities of business and digital transformation by getting in touch with us today.
Authentication tokens in Splunk allow you to access Splunk via the REST interface, usually serviced on port 8089 on a search head, without needing to pass a username/password combinations in the call. The type of tokens Splunk employs are JSON web tokens.
To utilize an authentication token to access Splunk via API, you would use a curl command something like the following:
To set up and administer tokens, go to Settings > Tokens (under “Users and Authentication”). To administer tokens, you need to have the “edit_all_tokens” capability.
Here is what you can do with the tokens in Splunk in terms of reporting and alerting:
For reporting, here’s an example SPL to get you started. NOTE: All of these searches and alerts should be run from the Monitoring Console app on your Monitoring Console instance so that all search heads can be queried and reported on at once. However, they could be run from any search head by changing “splunk_server_group=dmc_group_search_head” to “splunk_server=local”:
| rest splunk_server_group=dmc_group_search_head /services/ authorization/tokens| convert ctime(claims.exp), ctime(claims.iat), ctime(claims.nbr)| rename claims.aud as audience, claims.exp as expiration_date, claims.iat as issued_at_date, claims.idp as identity_provider, claims.iss as issuer, claims.nbr as not_before_date, claims.roles as roles, claims.sub as user, headers.alg as algorithm, headers.kid as kid, headers.ttyp as token_type, headers.ver as version, lastUsed as last_used_date, lastUsedIp as last_used_from_ip_address, title as token
| eval last_used_date=if(last_used_date=0,"not yet used",strftime(last_used_date,"%m/%d/%Y %H:%M:%S")), last_used_from_ip_address=if(last_used_from_ip_address=""," not yet used",last_used_from_ip_address)
| table token status user roles audience issued_at_date not_before_date expiration_date last_used_date
last_used_from_ip_address issuer issued_at_date identity_provider splunk_server
You can also find token-related setup information at:
An example alert you could use for expiring tokens, say those that are going to expire in the next 30 days:
| rest splunk_server_group=dmc_group_search_head /services/ authorization/tokens
| where ‘claims.exp’ < relative_time(now(),”+30d”)
Additionally, with the “not before date” (claims.nbr) entry, it would be possible to set up multiple future-date, even overlapping, tokens for the same user. So, for example, you could set up two tokens for an API user today–one starting today for the next 90 days and one that started on day 89 and extended 182 days. This would give you two tokens spanning six months that had a two-day overlap period. Now, set an alarm on your calendar on days 89 and 90 to, on one of those days, go into the source system using the token to send API calls to Splunk and swap out the old token for the new one. You’d have two days to get the swap out made and potentially no loss of service.
If you would like additional support with your authentication tokens in Splunk or any other Splunk issue please contact us right away.
Splunk recently released its 2nd annual State of Observability Report based on surveys from 1250 observability practitioners, managers, and experts across various industries. It measures their success with observability as the organizations accelerate the transition of workloads to the cloud, public cloud, and multi-cloud environments while also shifting more applications to a cloud-native architecture.
It’s clear from the report that observability is becoming a business imperative as organizations embrace cloud-centric environments. It’s also evident that the more mature a company’s observability platform, the greater the ROI and bottom-line impact observability can make in the organization.
Specific findings:
● Companies with robust observability platforms are 2.1x likely to detect problems in internally developed applications in minutes.
● Leaders in observability adoption report a 69% improvement in resolution means time for performance degradation or unplanned downtime.
● Organizations with a mature observability platform achieve an average annual cost of downtime of $2.5 million – compared to $23.8 million for beginner observability platforms and even more-so for companies without any observability platform.
There is a growing recognition that to achieve observability maturity; observability must be built into the DNA of the organization. An increased focus on automation and collaboration are also critical to scaling and maturing observability efforts.
Four Focus Areas for Achieving Observability Maturity
As a Splunk MSP and Splunk 2021 Partner of the Year, TekStream has had a front-row seat in working with clients at all levels of observability maturity, and our experience echoes many of the issues covered in the report.
Here are four criticalareas for organizations looking to apply observability to improve their operational efficiency and reduce service-affecting downtime and security vulnerabilities:
1. Monitor Microservice-Based Architecture
According to the 2021 State of Observability Report, cloud-native applications are significant and expected to grow, with 34% of internally developed applications using containers and microservices-based architecture in a cloud-native environment.
There are many moving parts in a microservices-based architecture, and it can be challenging to get visibility into each. Companies with mature observability protocols know that Splunk can help them monitor each service and the interactions between those services.
Observability provides granular insight into the health of microservices performance and relationships, in real-time, through the open-source open telemetry collector for gathering metrics and traces.
Even better, as the system is built with cloud-native and microservices architectures, Splunk Observability comes with hundreds of integrations and pre-built visualizations.
2. Ensure True End-to-End Visibility
Splunk Observability tools provide visibility into an application’s health, uptime, and user experience, from infrastructure to front-end performance. This level of visibility allows you to see precisely how the health of one component of an application affects the application’s performance.
Here again, we see organizations that have invested in maturing their observability skill set achieve greater levels of visibility compared with organizations that are starting on their observational journey – although even self-proclaimed beginners in observability can achieve better visibility than those companies with no observability platform.
The report found that 66% of leaders stated their visibility into application performance is excellent. 64% of this same group reported visibility into their security position was excellent. When asked these same questions, only 44% of observability beginners claimed excellent visibility into their application performance, while 42% of beginners stated they had excellent visibility into their security practices.
3. Gain Confidence with More Reliable and Faster Development
The report found that year over year, confidence in using Splunk Observability for reliable and faster development rose for all levels.
However, only 35% of Spunk Observability users stated they were completely confident that they could meet application performance and availability requirements, whereas 71% of Splunk Observability leaders could confirm confidence across the same areas.
There are a few key areas where Splunk Observability can help organizations gain confidence in their development process:
● Application performance monitoring (APM),
● Distributed tracing
● Log management
● Anomaly Detection
4. Use Splunk Observability Under the Guidance and Support of Your MSP
Splunk Observability maturation doesn’t happen by accident. It takes careful planning, leadership buy-in, capital investment, and a roadmap to success. It also takes time.
This is where a trusted MSP can provide significant value.
Finding the right partner can help your organization reach maturity quicker, more efficiently, and at a reduced cost. We developed our QuickStream process for Splunk Observability Cloud to begin delivering value in 2-3 weeks. Not months.
Together, we can help you reap the benefits and improved ROI that can come from a mature Splunk Observability implementation:
● Global Monitoring of Amazon Container Services
● Real-time Fidelity Tracing
● Automated Incident Response
The Future State of Observability
The future state of observability is likely to be more data-driven and automated. The proliferation of the cloud and the continued pressure to bring ideas to market quicker will drive the need for organizations to invest in maturing their observability platform. And as systems become more complex, observability will become even more essential. If you’re not already using observability to monitor your system, now is the time to start.
Whether your organization is new to the concept of observability, or your team is well-seasoned with the Splunk Observability Platform, TekStream can help. We have deep experience helping to guide our clients through their observability maturation journey – regardless of their starting point.
To learn more about our Splunk Observability capabilities, contact us today.
By default, ITSI allows you to perform several actions around episodes created from notable events. Under the Action Rules tab in our ITSI Aggregation Policy, we can see a list of these default actions. This blog will walk through where these actions are configured, and how to add additional alert actions to this list.
For Splunk Enterprise, command line access will be required
For Splunk Cloud, a support ticket will be needed to make the following config changes.
These alert actions can be found under the SA-ITOA app on the ITSI Search Heads. We can view the default action configs by navigating to splunk/etc/apps/SA-ITOA/default and viewing notable_event_actions.conf. Here we see a stanza for each of the default actions available. For any additional actions, we simply need to add a stanza to this configuration and enable it.
As a prerequisite, for any alert action that you wish to add to your aggregation policies, the alert action must exist on the ITSI Search Head. Whether from a custom-built action, or a supporting Splunk add-on. In this example, we’ll be adding a Slack alert action to the aggregation policy, so the “Slack Notification Alert” app is installed on our search head.
First, we’ll need to get the name of the alert action by checking alert_actions.conf. For our slack example, we’ll navigate to the Slack Notification Alert app, which can be found under splunk/etc/apps/slack_alerts. In the default directory, there is a conf file named “alert_actions.conf” that contains the name of the alert action as the stanza name, and the configuration settings below. We’ll grab the stanza name to use in ITSI. For this example, the stanza name is “[slack]”.
Note that all backend changes to configs should be made under the local directory, never default, so we’ll want to make this change in splunk/etc/apps/SA-ITOA/local/notable_event_actions.conf. You may need to create the local directory and notable_event_actions.conf if it does not already exist in this app.
Once created, we will make a stanza for the alert action. I want to add a Slack alert action, so in splunk/etc/apps/SA-ITOA/local/notable_event_actions.conf I will add the following stanza and save the file.
[slack]
disabled = 0
This change will require a restart of Splunk. After restart, visiting the Action Rules tab now shows the Slack action as an option.
Clicking “Configure” will show the configuration options of the alert. In this case, defining what Slack channel we want to send to, and what the messaging should be. Global settings, such as the name of the Slack Webhook URL, can be defined within the add-on itself, but overwritten of ITSI if needed.
Splunk works best with structured data. This blog post will cover how to make unstructured data searchable. In this real-world example, the customer wanted to use data in the second table of an unstructured log file. Changing the log format was not an option, and access to .conf files was not available, so all changes needed to happen at search time.
Raw log sample:
As you can see, there are two tables of data in the log. The first step is to remove the top table from the results since it’s unnecessary for this search. We will do that using the rex command to over-write _raw capturing only the data that we need.
The next step is to use the multikv to break the tables into separate events. This command will attempt to create fields and values from the table however, in our case, we removed the headers from the table because the formatting of our table was not clean. This caused the multikv command to not work properly. Since we removed the headers, we will set them to noheader=t.
Now, the last thing we need to do is create our field extractions, and then we can use the data however we please.
As you can see, we now have nice clean data!
Other uses of the multikv command:
Depending on your data, there are other ways to use the multikv command. Neither of these examples was able to make unstructured data searchable for our customer, but I recommend trying them with your data. Your success with the following examples will depend on how cleanly formatted your logs are.
In our example, we stripped out the headers of the table to make unstructured data searchable. You may be able to leave the headers. That would save you from extracting the fields with the rex command. Also, by default, the command will attempt to process multiple tables within the log, so you might just have to use the multikv command. After running this search, check to see if the correct fields were extracted.
You can also tell the command what row contains the headers of the table. This would allow you to always look for the headers on the first, second, etc row of the event. Again, check and see if the correct fields were extracted after running this command.
Zubair Rauf | Senior Splunk Consultant – Team Lead
In the past few years, Splunk has become a very powerful tool to help teams in organizations proactively analyze their log data for reactive and proactive actions in a plethora of use cases. I have observed almost every Splunker monitor Splunk Alerts for errors. Splunk Alerts use a saved search to look for events, this can be in real-time (if enabled) or on a schedule. Scheduled alerts are more commonplace and are frequently used. Alerts trigger when the search meets specific conditions specified by the alert owner.
Triggered alerts call alert actions which can help owners respond to alerts. Some standard alert actions are to send an email, add to triggered alerts, etc. Other Splunk TAs also help users integrate external alerting tools like PagerDuty, creating JIRA tickets, and many other things using these tools. Users can also create their own custom alert actions which can help them respond to alerts or integrate with external alerting or MoM tools. There are times that they may fail due to different reasons and a user may not get the intended alert they set up. This can be inconvenient for users and if the alerts are used to monitor critical services, this can have a financial impact as well and can prove to be costly if alerts are not received on time.
The following two searches can help users understand if any triggered alerts are not sending emails or the alert action is failing. Alert actions can fail because of multiple reasons, and Splunk internal logs will be able to capture most of those reasons as long as proper logging is set in the alert action script.
Please note that the user running the searches need to have access to the “_internal” index in Splunk.
The first search looks at email alerts and will tell you by subject which alert did not go through. You can use the information in the results of
index=_internal host=<search_head> sourcetype=splunk_python ERROR| transaction startswith=“Sending email.” endswith=“while sending mail to”| rex field=_raw “subject”=(?P<subject>[^”]+)””| rex field=_raw “-s(?<error_message>.*)swhilessendingsmailsto:s(?P<rec_mail>.*)”| stats count values(host) as host by subject, rec_mail, error_messageNote: Please replace <search_head> with the name of your search head(s), wildcards will also work.Legend;host - The host the alert is saved/run onsubject - Subject of the email - by default it is Splunk Alert: <name_of_alert>rec_mail - Recipients of the email alerterror_message - Message describing why the alert failed to send email
The second (below) search looks through the internal logs to find errors while sending alerts using alert actions to external alerting tools/integrations
| transaction action date_hour date_minute startswith=“Invoking” endswith=“exit code”
| eval alert_status = if(code=0, “success”, “failed”)| table _time search action alert_status app owner code duration event_message| eval event_message = mvjoin(event_message, “ -> “)| bin _time span=2h
| stats values(action) as alert_action count(eval(alert_status=“failed”)) as failed_count count(eval(alert_status=“success”) as success_count latest(event_message) as failure_reason by search, _time| search failed_count>0
Note: Please replace <search_head> with the name of your search head(s), wildcards will also work.
These two searches can be setup as their own alert, but I would recommend setting these up on an Alert Monitoring dashboard. Splunk Administrators can monitor Splunk Alerts periodically to see whether any alerts are failing to send emails or any external alerting tools integrations are not working. Splunk puts a variety of tools in your hand but without proper knowledge, every tool becomes a hammer.
To learn more and have our consultants help you with your Splunk needs, please feel free to reach out to us.