Tag: Splunk Cloud

  • How to Avoid Skipped Searches in Splunk Cloud

    How to Avoid Skipped Searches in Splunk Cloud

    By Kamal Dorairaj, Senior Splunk Consultant

    When working in Splunk, scheduled searches often skip or cannot execute for one reason or another. If a search got skipped, a scheduled job waits on the line for the search slot and the job sits in deferred status. If the scheduling window expires, the search does not run and the job resets to skipped status.


    Reports, alerts, data models and many app dashboards like Enterprise Security (ES) depend on your scheduled searches. When these searches do not run in the scheduled time window, the overall Splunk environment becomes unreliable because of missing data or incorrect data in the dashboards and reports. This can cause you to miss crucial alerts and can slow the performance of dashboards.

    How to Find Skipped Searches in Splunk Cloud

    The below spls show any scheduled searches that are being skipped, the reason why and the savedsearch name. Time range of last 7 days is a good place to start, and can go back up to 30 days.

    index=_internal sourcetype=scheduler status=”skipped” | stats values(savedsearch_name) count by reason
    index=_internal sourcetype=scheduler savedsearch_Name=* status=skipped | stats count by reason
    

    Skipped Search Reasons and Solutions

    These are the most common reasons for skipped searches in any Splunk Cloud stack:

    Reason 1: The maximum number of concurrent running jobs for historical scheduled searches on this instance or cluster has been reached.

    Explanation: By default, only one instance of a given search is kept running at the same time. Therefore, if the search is already running for scheduled_time and when the next cron scheduled _time comes due for the next run, the scheduler will not execute the next job. So, the next scheduled search job is skipped now because the previous scheduled search job for the same saved search is still running. Example: The cron schedule configured to run the search every 5 minutes but the search itself takes 10 minutes to complete.

    Solution:
    a. Tune the spl of the search job to run within the configured time window. If possible, shorten the earliest time for the job.
    b. If you cannot improve the search runtime, then increase the cron period to make sure it’s more than the search execution time.

    Reason 2: The maximum number of concurrent historical scheduled search on this cluster has been reached or the maximum number of concurrent auto-summarization searches has been reached.

    Explanation:
    Each Splunk cloud stack is configured to run a maximum number of concurrent searches. We can find it under Settings -> Search Preferences -> Limits set for scheduled searches and summarization searches. As a cloud customer, set these values in the backend in the limits.conf. When we change the percentage from 50% to 75%, we can see the number of search slots for the scheduled searches and summarization searches (DM) increased. Before increasing this concurrency limit, please make sure all the best practices listed in the below Solution section are implemented. Example: If a DM skipped for last 5 minutes acceleration then when it runs the next time it tries to run for last 10 minutes data. If that is also skipped, the next time it tries to run for last 15 minutes data and keeps accumulating.

    Solution:
    a. Avoid scheduling search jobs at the top of the hour, like 10:00 am, 11:00 am or 10:30 pm, 11:30 pm, etc. It means we are scheduling too many searches at the same time. Tune the cron schedules of the scheduled jobs to fire on different minutes, which makes the load spread through the hour/day.
    b. Disable unused scheduled searches. Remove unused apps and TA’s.
    c. Not all the DMs need to be accelerated. Only if the summary data is more than 1GB is the acceleration useful.
    d. Consider workload management. The following rule limits the number of concurrent ad hoc searches to 50% of the total search concurrency limit, which in turn provides more search slots for scheduled searches and summarization searches: search_type=adhoc AND adhoc_search_percentage >50.
    e. Create WLM rule to place prioritized searches in the high priority pool to get them maximum resources and hence the search completes faster.
    f. Tune Datamodel to search only the indexes needed.

    Best practice setup for search jobs can eliminate skipped searches and incomplete data. Following the quick tips here will ensure more thorough alert reporting and faster dashboards.

  • Dynamic Inputs: Make Your Splunk Dashboards More Flexible

    Dynamic Inputs: Make Your Splunk Dashboards More Flexible

    By Nate Hufnagel, Splunk Consultant

    Splunk’s dashboarding capabilities separate it from the rest of the pack. The ability to normalize and visualize data in a way that’s meaningful to all levels of an organization is one of the many reasons it has been widely adopted by businesses in nearly every industry. To achieve this level of versatility, Splunk dashboards come out-of-the-box with powerful features that allow users to create flexible and reusable templates. One of those features is the dynamic input.

    Dynamic Inputs: Pros and Cons

    Dynamic inputs let you pass one or more values to a panel by using a separate SPL search to populate a list of values. When a user loads a dashboard with dynamic inputs, the populating searches run automatically and return the list of values.

    Pros

    Dynamic inputs (by definition) are non static, which makes them good for data that changes frequently. That translates to less time reworking inputs to fit incoming data, making your dashboards more flexible.

    Cons

    It adds another search, and could eat up more resources. This is why we need to make it as performative as possible, and we’ll use tstats to do that.

    What is tstats and How is it Used?

    Tstats is a generating command that performs statistical queries on indexed fields (as opposed to search time fields). It works similarly to the stats command and even uses the same functions, with one key difference: tstats performs these operations on the tsidx files, as opposed to the raw data in the indexes. This makes tstats much faster than stats: it’s like looking at the table of the contents for information instead of flipping through the whole book.

    Implementing tstats Into the Dashboard Inputs

    Imagine a Classic dashboard panel showing the top sources by host for a given index. Perhaps this is shown through a piechart visualization. If the list of possible hosts changes frequently, or are too numerous to type by hand, a dynamic input token might be the right tool for the job.

    Pie chart visualization in Splunk showing the distribution of log file sources by host. The majority of the data originates from a Windows-based universal forwarder path, with additional sources from various Linux-based log files.

    In the dashboard while in Edit mode, select “Add Input” and choose the appropriate input type for your use case.  In this example, the Dropdown option will do nicely.  These are the important settings and their values:

    • Under “General” – set the appropriate label and make sure “Search on Change” is selected. 
    • Under “Token Options” – give the “Token” field the name of the token to use for this input.
    • Under “Dynamic Options” – the “Search String” text box is where you’ll put the search that dynamically returns the values.  This is where the tstats search will go.  Two things to consider: make sure the search returns a list of values, and be sure to set the time range appropriately for your use case. With tstats you can look over longer time ranges without drastically impacting how long the search runs. Set the values for “Field for Label” and “Field for Value”, which can both be the name of the output field (in most cases). Below is a simple example:
    | tstats values(host) where index=<your_index_name>
    | rename values(host) as Hosts
    | stats list() by Hosts
    
    Dynamic dropdown configuration panel in Splunk dashboard settings. The configuration uses a search string to populate the dropdown with host values from a specified index over the last 60 minutes.

    Once finished, click “Apply”. Double check that your search is returning the correct results and each host is selectable in the dropdown. Finally, add the input token you just created to the appropriate search(es).

    Splunk dashboard editor displaying a checkbox input configuration. Multiple dynamically populated host values are shown as selectable options using a token named “host_token.”

    That’s it! You can add multiple dynamic inputs to your dashboard by repeating these steps, or pass multiple values through a single token by making a few changes:

    1. Instead of using the Dropdown input, select “Checkbox” or “Multiselect”
    Splunk search query using a tokenized input. The query filters internal index logs based on selected hosts and uses the top command to return the five most frequent sources.

    2. Adjust the SPL in the relevant panels to accept multiple values:

    Screenshot showing how to adjust the SPL in the relevant panels to accept multiple values.

    My guess is that this will demonstrate that Splunk really does stand out from the pack. With the ability to normalize and visualize your data, you’ll provide actionable insights and put your company on the path to success using Splunk. Fill out the form below if you’d like to ask more. Happy Splunking!

  • Creating Splunk Cloud Architecture Diagrams Using Lucidchart

    Creating Splunk Cloud Architecture Diagrams Using Lucidchart

    By Kamal Dorairaj, Senior Splunk Consultant

    Knowledge is valuable, and in the case of the Splunk installation at your firm a visual representation of the platform configuration becomes a key asset. The diagram gives better understanding of the Splunk Cloud Implementation and is useful for internal training as well as documentation needs at your company. In this blog, we will offer a step by step process for creating a Splunk cloud architecture diagram using Lucidchart.

    The architecture diagram is best created in Lucidchart, which has all Splunk shapes, icons and images. It also has a library of shapes for all of the leading products you may be using, like AWS, Google Cloud Platform (GCP), Azure and other security products. You can also import shapes from external sources and use it for the diagram. Lucidchart provides options to export the diagram in various formats including pdf, Visio, jpeg, png and csv.

    Discovery

    In the discovery phase you will gather all the information required for the architecture diagram. Ask yourself these questions to ensure you include the essential materials:

    • Which Splunk systems are being used in the environment? Examples include UF, HF, DS, etc.
    • Where do the UFs forward to? Heavy Forwarders, Indexers, or a mix?
    • What kind of data collection is taking place? Ex: Syslog, HEC, API.
    • What is the list of data sources per HF? This will include the vendor/product lists.
    • Which host has what type of Apps/Data collection?
    • What are the IP, host name, cpu/memory/disk spaces of each HF/UF/DS?
    • Are you using Splunk Premium Products in addition to Splunk Enterprise? These might include enterprise security, UBA or ITSI.

    Diagram Creation Process

    The diagram should be closely associated to the Splunk Validated Architecture based on the environment.

    Architecture Layers
    Login: Users access Splunk Cloud Search Head through ‘https 443’ via the internet.

    Splunk Cloud Search Head Tier and Indexing Tier: The Search Head on the cloud got an Adhoc SH (customer.splunkcloud.com) and SH for the premium product if there is one. Ex: ES SH (escustomer.splunkcloud.com). The SH on the Cloud talks to the Indexing Cluster Tier through port 8089. Splunk does not allow to put any indexers or search head host details in the diagram.

    Getting Data thru HEC and API: Apps or data that send through HEC (http event collector) token-based to Splunk Cloud Platform is a fast and efficient way. The HEC data flows to Splunk Cloud through port ‘https 443’. Getting Data in through APIs to Splunk Indexing layer by configuring the API inputs through an authentication type.

    On-Prem Collection Tier: This part of the architecture lives on the customer network side. We have Heavy Forwarder and Universal Forwarder. The instances could be on unix or windows. Both the HFs and UFs forward the data to the Splunk Indexing tier thru port ‘TCP 9997”.

    On-Prem Management Tier: The DS has all the apps and config files which pushes the changes thru ‘TCP 8089” to the HFs and UFs. Many times, the license master is installed in the same DS server instances.

    Syslog Sources: There could be single or multiple syslog sources that send data thru ‘TCP UDP 514’ in a network load balancer to the UFs or HFs. The syslog can also configure to flows thru SC4S.

    PORT Details:
    TCP 8089 -> Splunk Management Port
    TCP 9997 -> Splunk Data
    HTTPS 443 -> Splunk Web
    TCP UDP 514 -> Syslog
    TCP 8191 -> KV Store Replication
    TCP 9777 -> SHC Replication
    TCP 9887 -> IDX Replication

    This is what a typical Splunk cloud architecture diagram will look like:

    Detailed architecture diagram of a Splunk Cloud deployment created in Lucidchart. The image shows multiple tiers: users connecting via HTTPS, the Splunk Cloud search tier, indexing tier, and on-premises tiers for collection and management. Data flow is represented with color-coded lines for different protocols, such as TCP 9997 for data and HTTPS 443 for web. Components include forwarders, heavy forwarders, syslog sources, SC4S, deployment servers, and AWS CloudTrail.

    Have fun creating diagrams of your own. As always, we are here if you have any questions. Contact us here:

  • How to Get CrowdStrike Data Into Splunk: A Step-by-Step Guide

    How to Get CrowdStrike Data Into Splunk: A Step-by-Step Guide

    By Dave Cheever, Splunk Consultant

    This blog will take you through the necessary steps to get CrowdStrike data into Splunk via API. Before starting, ensure the CrowdStrike App and Technical Add-On (TA) are installed in your Splunk environment. For Splunk Cloud, simply install both the App and TA using your Search Head. For on-prem instances, the CrowdStrike App should be installed on Search Heads and the TA should be installed on Indexers or Heavy Forwarders depending on where your data will be collected and parsed. Don’t forget to also create an index for your new CrowdStrike data.

    Phase One: Generate an API key in CrowdStrike

    Navigate to SUPPORT AND RESOURCES within the Falcon console to manage API clients and keys used by your organization. Select API CLIENTS AND KEYS to view, edit, or create an API:

    CrowdStrike console sidebar with “Support and resources” expanded and “API clients and keys” highlighted in red, indicating where to initiate API setup.

    Your account’s cloud base URL for API interactions is located on the top of this page. Select ADD NEW API CLIENT to generate a new API:

    The API Clients and Keys dashboard in CrowdStrike, showing a list of OAuth2 API clients with a red arrow pointing to the Base URL and a button to add a new API client.

    Provide an API client name, a description for this API, and select your API scopes. At a minimum, you’ll want to select EVENT STREAMS as seen below:

    Add new API client form in CrowdStrike, showing fields for client name, description, and selectable API scopes such as “Event streams.”

    Record your API secret somewhere safe. Once this window is closed, the secret is no longer available. This information will be used when configuring the TA within Splunk:

    Confirmation screen showing newly created API credentials in CrowdStrike including client ID, secret, and base URL with a reminder to copy credentials.

    Phase Two: Configure the CrowdStrike TA in Splunk

    In the CrowdStrike Falcon Event Streams TA, select CONFIGURATION toward the top of the page. Within the Account tab, click ADD and enter the details below:

    • Account Name: This can be whatever you want as it is only used in context of this TA.
    • Username: Client ID from the API client generated above.
    • Password: Secret from the API client generated above.

    Splunk Add Account dialog box where the CrowdStrike API client credentials are entered including account name, username, and password.

    Next, go to INPUTS on the top of the page and select CREATE NEW INPUT. Enter the required information as seen below. Note that the API Credential dropdown will now have your CrowdStrike account created in the last step:

     Splunk configuration screen for adding CrowdStrike Event Streams input with fields for name, interval, index, API credential, and application ID.

    Once saved, you will see your new input has been created. It may take several minutes for events to start coming into your CrowdStrike index (i.e., index=crowdstrike). The CrowdStrike Falcon app will also start populating as data comes in. The home view defaults to the last 24 hours, so you may need to expand your time range to make the dashboard populate.

     Splunk dashboard showing CrowdStrike detections and events, with tile visualizations for total events, detection counts by status, severity breakdown and trends.

    If you have additional questions regarding configuration of the CrowdStrike app or onboarding of data, reach out to our team here at TekStream.

    We look forward to hearing from you!