Category: Blog

  • Managed Security’s Evolution, From an MDR Provider’s Perspective – It’s Alphabet Soup

    Managed Security’s Evolution, From an MDR Provider’s Perspective – It’s Alphabet Soup

          By: Bruce Johnson  |  Director, Enterprise Security

    Updated February 21, 2023 – I’ve been in IT for a minute – so long there should be a Stones song about me. I’ve been involved for decades, and experienced the evolution of execution platforms that provided innovative solutions to improve the “ilities.” But it has been a rarity to see security advances built hand-in-hand with those core platform improvements. So it was with client/server, and so it is now with microservices, the cloud, and mobile platforms.

    The challenge now is exponentially more complex than it was when I was a wee nerdling. At this point, the security challenge is so varied, dynamic, and effective that our threat surface looks like a quilt stitched by Edward Scissorhands. Our approach to security must rapidly adapt, and it has to start with the assumption that hackers are inside the house using tools that aren’t on standard threat lists.

    The only thing propagating as quickly as threats are acronyms. From FW to NGFW, or IDS to IPS, MSSP to [N|M|E|X]DR, the alphabet soup of acronyms of security keeps expanding. Rather than focusing on terminology, TekStream came up with a simple and effective measure of clients’ security maturity several years ago based on three dimensions: visibility, fidelity and automation. We view these as the principal measures that differentiate modern SOC performance effectiveness. These measures have held up as the environment has evolved, and they serve as a way of simplifying the evaluation and application of technologies and appliances in the security space across security layers and solutions. You can look at any security solution and map its evolution along those lines:

    • Visibility is essentially an expanding field of view to internal and external threat sources, data sources, appliance feeds, partners, and intelligence.
    • Fidelity is a measure of the degree of accuracy in identifying threats. Every tool has an ML layer that evolved from simplistic standard deviations to identify outliers. The degree of accuracy depends upon empirical, easily measured results. The search for noise reduction never ends. Data fidelity in cybersecurity is perfected when you don’t have false positives…and let those among you without any false positives cast the first stone.
    • Automation is a continuum that goes from manual detection to fully automated prevention. Automation never stops growing as we interact with a widening variety of tools across security layers and discover new Indicators of Compromise (IOCs) that determine malignancy or lack thereof.A static security solution is a false sense of security, and people tend to underestimate the care and feeding. Detection is great but responding is better and preventing is best.Prevention seems to be the trend from security-focused orchestration registries for micro-services to XDR (Extended Detection and Response) technologies that lock down lateral movement. Security Information and Event Management (SIEM) tools are adopting integrated Security Orchestration, Automation, and Response (SOAR) tools to move to a closed-loop security process. Detecting a threat is fine, but it mirrors the analogy that differentiates a dental consultant from a dentist.

    Using those measures, it becomes easy to evaluate or categorize solutions into the following areas:

    • Intrusion Detection Systems (IDS) evolved into Intrusion Prevention Systems (IPS) or Intrusion Detection Prevention Systems (IDPS), increasing fidelity and automation.
    • Network Detection and Response (NDR) solutions (originally Network Traffic Analysis) are evolving to include expanding fidelity and automation. The strength of analyzing north/south and east/west traffic patterns is inherent in the solutions. The ML models to identify outliers in terms of network traffic patterns are improving and there is some limited automation to interact with network devices or surface alerts in response to identified threats. Automation for any specific layer of security solutions seems to be limited to the visibility inherent in that domain, so, outside of enterprise SIEM/SOAR solutions, automation is rarely comprehensive.
    • Endpoint Detection and Response (EDR) do exactly what they describe: They detect and respond to threats against endpoints. They provide a high degree of detection, automation, threat response, and threat prevention across managed endpoints. They have been expanding to include greater visibility to layers supporting endpoints to include LDAP, authentication, antivirus, etc. They often optionally incorporate managed service solutions or managed detection and response (MDR) services that cover those endpoints. SIEM solutions are underlying some of those solutions and their scope is expanding to cover more and more of the threat surface.
    • Extended Detection and Response (XDR) is an up-and-coming cybersecurity service offering and is an evolutionary step to expand detection and response beyond endpoints and SIEM/SOAR solutions. Gartner defines it as “a SaaS-based, vendor-specific, security threat detection and incident response tool that natively integrates multiple security products into a cohesive security operations system.” It promotes a natively integrated, unified vendor approach. XDR emphasizes containment, remediation, and repair across the security infrastructure. It limits access to portions of the network, revokes credentials, restricts the use of cloud-based applications, removes messages from inboxes, etc. But, as there are no limitations to enterprise SOAR tools from performing these same types of automation steps, the distinctions are often amorphous. XDR solutions provide higher fidelity with limitations to visibility, while enterprise SIEMS provide broader visibility with a need to improve fidelity. XDR does seem to be expanding upon automation to encompass endpoints which we find to be an essential extension to a pure SIEM/SOAR solution

    Managed Security Service Providers (MSSP) are morphing into Managed Detection and Response (MDR) providers largely by expanding automation  – becoming proactive in response rather than reactive/prescriptive. Of course, as we’re in the MDR game, we actually expanded along all three maturity dimensions. We started our security journey with Splunk’s solutions. The Security solutions from Splunk are still uniquely able to provide enterprise-level visibility and correlation/orchestration across the entire threat surface, solving the swivel-chair security process. The inclusion of SOAR has elevated our ability to automate time-critical tasks and provide more elegant triage and response workflows. There is still room to grow in this world as there is limited ability to prevent intrusions without owning endpoints or network devices. Augmenting this platform with a superior EDR solution effectively covers some of the more critical threat responses that protect the core security layers (1-4) – see diagram below. These layers are broadly garnering more attention in light of supply chain threats and compromised third-party ingress points. APTs (Advanced Persistent Threats) are obviously successfully breaching outer layers.

    A semi-circular layered diagram illustrating a multi-tiered cybersecurity model with concentric layers labeled: data, users, application security, endpoint security, network security and perimeter security—representing the depth and complexity of modern managed detection and response (MDR) strategies.

    As the cybersecurity battlefield continues to get more sophisticated in both offensive and defensive strategies and armament, we are fully aware that our clients’ security maturity is never at 100% and the process is one of continuous learning, adapting, and adopting the most effective tools and processes to help clients keep their data, business operations, and reputations secure. And the alphabet soup we swim in is just part of the deal.

    If it’s time to assess your security maturity across the three dimensions of Visibility, Fidelity and Automation, connect with us using the form below:

  • Spruce Up Your Dashboard Panels with Dynamic Y-Axis Labels/Units

    Spruce Up Your Dashboard Panels with Dynamic Y-Axis Labels/Units

          By: Marvin Martinez  |  Splunk Consultant

     

    Dashboards in Splunk, and the panels within those dashboards, are extremely versatile and powerful. Sometimes, however, wide variances in the underlying data being analyzed and displayed in those panels can make it hard to effectively relay that information when the data has varying degrees of magnitudes or when you’d like the axes to contain dynamic labels depending on the data being shown. Today, we’ll look at a relatively small, but mighty, method that can be implemented in your dashboards to help bolster the way your dashboard panels display your key data.

    In this example, we’ll examine a case where a panel is displaying metrics for daily ingestion for a given index. The data is coming from a summary index and shows ingested megabytes (MB) over time. However, depending on the index, the ingestion may be better displayed in terms of GB, or even TB. In this case, the y-axis of the chart would not look its best if the values looked like “2,000,000 MB” as that is not a practical and easy-to-read display of the data.

    The first step is to determine what units are most prudent to display for the index in question. To do this, a global base search is leveraged to determine the expected units. In the example search below, the base search retrieves all the MB values for the specified index, takes an average of the values, and compares it against thresholds for TB (1024*1024 MB), GB (1024 MB), and MB (default case). Depending on the value of the average, the search returns a specific “Metric” (or “Units”) result that is inserted into a dashboard token that will be used later.

    XML code snippet showing a baseSearch block with Splunk SPL query that dynamically sets the unit of measurement (MB, GB, or TB) based on average data ingestion.

    Once the desired units are determined, there are only two things that need to be done to ensure any visualization going forward can leverage it accurately and successfully:

    1. Ensure your chart SPL is doing the same conversion (“normalization”) to ensure data integrity.
    2. Assign the derived unit’s value as the y-axis label.

    In the visualization SPL, the eval statement below was included to “normalize” the data and ensure that the actual values match the units that are noted by the y-axis label. Do this for any other values that may need to be normalized as well. If necessary, the “Metric” field can be removed in your SPL later, or you could just use the token in the CASE statement itself. The “Metric” field was just created for ease of use in the subsequent eval expression.

    |eval Metric = $metricTok|s$, Actual = CASE(Metric = “MB”, Actual, Metric= “GB”, round(Actual/1024,2), Metric = “TB”, round(Actual/1024/1024,2))

    Finally, in the options for your chart, add an entry for “charting.axisTitleY.text” and assign the dashboard token set in your base search as the value, as shown below.

    Code snippet highlighting a dynamic charting Y-axis label using the token $metricTok$ for unit adaptation.

    The end result, as shown in the images below, is a dynamic y-axis label that adjusts to the units that best suit the underlying data and make it easy to read instead of having to wade through various zeroes in the intervals! The images below are the same chart displaying data from three separate indexes with varying ingestion totals, each displaying in the units best suited for the selected index.

    Dashboard panel showing a time-series line chart comparing daily ingestion versus prior day values with Y-axis labeled in MB.

    Dashboard panel showing a time-series line chart with increased ingestion levels and Y-axis labeled in GB.

    Dashboard panel displaying a time-series line chart for large-scale ingestion trends, with Y-axis dynamically updated to TB units.

    Using tokens allows for great versatility and power in your dashboards. Now, even the axes can be easily configured to dynamically adjust to your wide-ranging values.

    Want to learn more about customizing your Splunk dashboards? Contact us today!

  • How to Enable Splunk Boot-Start Using Systemd

    How to Enable Splunk Boot-Start Using Systemd

          By: Jon Walthour  |  Senior Splunk Consultant, Team Lead

    Splunk switched to a default of enabling boot-start to systemd back in 7.2.2. It did this because using systemd has become the default system initialization and service manager for most major Linux distros. They switched back to using SysV init in version 7.3 to 8.1.0 because of shortcomings in how Splunk was utilizing systemd for service startup and shutdown. Since the startup and shutdown actions prompted for root credentials, this broke many automated processes out in the wild. It wasn’t until version 8.1.1 that an option was added to the “enable boot-start” command to install “Polkit” rules to grant non-root users like “Splunk” to have a certain level of centralized system control to allow for the starting and stopping of the Splunk systemd service. Starting with version 8.1.1, the preferred method for setting up boot-start for Splunk Enterprise is via systemd. What are the advantages of using systemd, you might ask? Plenty. First, systemd offers parallel processing to allow more to be done concurrently during system boot-up. Additionally, it allows for a standard framework for expressing dependencies between processes. This means, in the case of the Splunk systemd initialization, Splunk’s startup can be dependent on network services starting successfully. The configuration of systemd is standardized with unit text files and does require the creation of custom scripts. Systemd also offers enhancements specifically to Splunk in that it provides a way to monitor and manage the splunkd service independent of Splunk itself. It provides tools for debugging and troubleshooting boot-time and service-related issues with Splunk — again, independent of the Splunk software itself. Most importantly, systemd allows for the use of Linux control groups (cgroups), which forms the backbone of the workload management features in Splunk Enterprise. Splunk Enable Boot-Start Overview
    1. Install Polkit (if not already installed).
    2. Edit the splunk.service file.
    3. Add a systemd service for disabling THP.
    4. Enable the whole thing and reboot.
    5. Check your work.
    Below are the steps to enable Splunk to start at system boot under systemd as well as other recommended operating system configurations for Splunk: 1. Install Polkit (if not already installed). sudo su - yum -y update yum -y install polkit sudo /opt/splunk/bin/splunk enable boot-start -systemd-managed 1 -systemd-unit-file-name splunk -create-polkit-rules 1 -user splunk -group splunk NOTE: If you get message “CAUTION: The system has systemd version < 237 and polkit version > 105. With this combination, polkit rule created for this user will enable this user to manage all systemd services. Are you sure you want to continue [y/n]?”, select “y,” then create the following two files and run the following chmod command: vi /etc/polkit-1/rules.d/10-Splunkd.rules polkit.addRule(function(action, subject) {      if (action.id {== "org.freedesktop.systemd1.manage-units" &&      subject.user ==} "splunk") {      try {          polkit.spawn(["/usr/local/bin/polkit_splunk", ""+subject.pid]);          return polkit.Result.YES;      } catch (error) {          return polkit.Result.AUTH_ADMIN;      }      } }); vi /usr/local/bin/polkit_splunk #!/bin/bash -x COMM=($(ps --no-headers -o cmd -p $1)) if [[ "${COMM[1]}" {== "start" ]] ||      [[ "${COMM[1]}" ==} "stop" ]] ||      [[ "${COMM[1]}" == "restart" ]]; then          if [[ "${COMM[2]}" {== "Splunkd" ]] ||             [[ "${COMM[2]}" ==} "Splunkd.service" ]]; then                  exit 0          fi fi exit 1 chmod 755 /usr/local/bin/polkit_splunk 2. Edit the splunk.service file and make the following adjustments: vi /etc/systemd/system/splunk.service File created in /etc/systemd/system/splunk.service: #This unit file replaces the traditional start-up script for systemd #configurations, and is used when enabling boot-start for Splunk on #systemd-based Linux distributions. [Unit] Description=Systemd service file for Splunk, generated by 'splunk enable boot-start' After=network.target [Service] Type=simple Restart=always ExecStart=/opt/splunk/bin/splunk _internal_launch_under_systemd KillMode=mixed KillSignal=SIGINT TimeoutStopSec=600 LimitCORE=0 LimitDATA=infinity LimitNICE=0 LimitFSIZE=infinity LimitSIGPENDING=385952 LimitMEMLOCK=65536 LimitRSS=infinity LimitMSGQUEUE=819200 LimitRTPRIO=0 LimitSTACK=infinity LimitCPU=infinity LimitAS=infinity LimitLOCKS=infinity LimitNOFILE=1024000 LimitNPROC=512000 TasksMax=infinity SuccessExitStatus=51 52 RestartPreventExitStatus=51 RestartForceExitStatus=52 User=splunk Group=splunk Delegate=true CPUShares=1024 MemoryLimit=<value> PermissionsStartOnly=true ExecStartPost=/bin/bash -c "chown -R splunk:splunk /sys/fs/cgroup/cpu/system.slice/%n" ExecStartPost=/bin/bash -c "chown -R splunk:splunk /sys/fs/cgroup/memory/system.slice/%n" [Install] WantedBy=multi-user.target Change or check the following settings in the splunk.service file:
    • – Change TimeoutStopSec to 600
    • – Add all Limit____ lines and TasksMax
    • – Check user and group
    • – Set MemoryLimit to the total system memory available in bytes
    • – Check both “ExecStartPost” chown is right user:group
    3. Add a systemd service for disabling THP: [Unit] Description=Disable Transparent Huge Pages (THP) [Service] Type=simple ExecStart=/bin/sh -c "echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled && echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag" [Install] WantedBy=multi-user.target 4. Finally, enable the whole thing and reboot: sudo systemctl daemon-reload sudo systemctl start disable-thp sudo systemctl enable disable-thp sudo systemctl start splunk sudo systemctl enable splunk shutdown -r now 5. Lastly, check your work to ensure (a) Splunk was started under systemd and (b) transparent huge pages is disabled and ulimits are set according to the values defined in the systemd init file. $ ps -ef|grep splunkd splunk 3848 1 3 12:10 ? 00:00:04 splunkd --under-systemd --systemd-delegate=yes -p 8089 _internal_launch_under_systemd splunk 4731 3848 0 12:10 ? 00:00:00 [splunkd pid=3848] splunkd --under-systemd --systemd-delegate=yes -p 8089 _internal_launch_under_systemd [process-runner] splunk 4931 4731 0 12:10 ? 00:00:00 /opt/splunk/bin/splunkd instrument-resource-usage -p 8089 --with-kvstore splunk 5504 5442 0 12:12 pts/0 00:00:00 grep --color=auto splunkd $ splunk status splunkd is running (PID: 3848). splunk helpers are running (PIDs: 4731 4749 4853 4931). cat /opt/splunk/var/log/splunk/splunkd.log | grep ulimit 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: virtual address space size: unlimited 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: data segment size: unlimited 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: resident memory size: unlimited 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: stack size: unlimited 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: core file size: 0 bytes 06-01-2021 12:05:17.513 +0000 WARN ulimit - Core file generation disabled. 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: data file size: unlimited 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: open files: 1024000 files 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: user processes: 512000 processes 06-01-2021 12:05:17.513 +0000 INFO ulimit - Limit: cpu time: unlimited 06-01-2021 12:05:17.513 +0000 INFO ulimit - Linux transparent hugepage support, enabled="never" defrag="never" 06-01-2021 12:05:17.513 +0000 INFO ulimit - Linux vm.overcommit setting, value="0" 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: virtual address space size: unlimited 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: data segment size: unlimited 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: resident memory size: unlimited 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: stack size: unlimited 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: core file size: 0 bytes 06-01-2021 12:10:55.997 +0000 WARN ulimit - Core file generation disabled. 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: data file size: unlimited 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: open files: 1024000 files 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: user processes: 512000 processes 06-01-2021 12:10:55.997 +0000 INFO ulimit - Limit: cpu time: unlimited 06-01-2021 12:10:55.997 +0000 INFO ulimit - Linux transparent hugepage support, enabled="never" defrag="never" 06-01-2021 12:10:55.997 +0000 INFO ulimit - Linux vm.overcommit setting, value="0"

    Want to learn more about Splunk boot-start and systemd? Contact us today!

  • Solving Splunk Issues: Expert Insights

    Solving Splunk Issues: Expert Insights

          By: Aaron Dobrzeniecki  |  Splunk Consultant

    After working with hundreds of Splunk customers over the years, I have found that there are a few main issues that customers deal with on a daily basis. The three main issues I will be discussing today are troubleshooting issues with data quality (source types not parsing properly), issues with search performance, and finally, issues with high CPU and Memory usage.

    Issue 1: Data Quality

    One way to check if your data is being parsed properly is to search on it in Splunk. Provide Splunk with the index and sourcetype that your data source applies to. If you see that your data does not look like it was broken up into separate correct events, we have a problem.

    Another way to check the quality of your data source is to run the below search in your environment. This is a modified version of a search from the Splunk Monitoring Console -> Indexing -> Inputs -> Data Quality. I have modified this search so that you can run this on any of your Splunk Search Heads.

    index=_internal splunk_server=* source=*splunkd.log* splunk_server=* (log_level=ERROR OR log_level=WARN) (component=AggregatorMiningProcessor OR component=DateParserVerbose OR component=LineBreakingProcessor)

    | rex field=event_message "Context: source(::|=)(?<context_source>[^\|]*?)\|host(::|=)(?<context_host>[^\|]*?)\|(?<context_sourcetype>[^\|]*?)\|"

    | eval data_source=if((isnull(data_source) AND isnotnull(context_source)),context_source,data_source), data_host=if((isnull(data_host) AND isnotnull(context_host)),context_host,data_host), data_sourcetype=if((isnull(data_sourcetype) AND isnotnull(context_sourcetype)),context_sourcetype,data_sourcetype)

    | stats count(eval(component=="LineBreakingProcessor" OR component=="DateParserVerbose" OR component=="AggregatorMiningProcessor")) as total_issues dc(data_host) AS "Host Count" dc(data_source) AS "Source Count" count(eval(component=="LineBreakingProcessor")) AS "Line Breaking Issues" count(eval(component=="DateParserVerbose")) AS "Timestamp Parsing Issues" count(eval(component=="AggregatorMiningProcessor")) AS "Aggregation Issues" by data_sourcetype

    | sort - total_issues

    | rename data_sourcetype as Sourcetype, total_issues as "Total Issues"

    See the results of the search below:

    Splunk statistics dashboard showing multiple sourcetypes with timestamp parsing and line-breaking issues.

    You will want to run the above search for at least the last 15 minutes. As you can see, it provides you with the number of Line Breaking issues, Timestamp Issues, and Aggregation Issues for each of your problematic sourcetypes. You can also drill down into the data by clicking on one of the numbers in the columns. In the screenshot below, you will see a warning for issues parsing a timestamp:

    Screenshot of a Splunk event log showing a timestamp parsing error and fallback to previous event time.

    Taking the proper steps to make sure your data is correctly parsed correctly will make it a lot easier when working to get value out of your data. The most important step is testing the ingestion of your data in a test instance or environment before implementing in prod.

    To correctly parse your data, you need the following 8 settings in props:

    On your Splunk Enterprise Boxes:

    • – LINE_BREAKER
    • – SHOULD_LINEMERGE
    • – MAX_TIMESTAMP_LOOKAHEAD
    • – TRUNCATE
    • – TIME_FORMAT
    • – TIME_PREFIX

    On the UF:

    • – EVENT_BREAKER_ENABLE
    • – EVENT_BREAKER

    Learn more about “the Great 8” in the TekStream blog.

    Issue 2: Search Performance

    Next, let’s discuss search performance. When creating and crafting searches in Splunk, you want to make sure you give Splunk as much detail as possible about the data you are trying to search. There are four important fields that Splunk looks at to determine which data to bring back for you: index, sourcetype, source, and host. When running searches in Splunk, make sure to include the index or indexes where your data lives, provide the sourcetype or sourcetypes, your source or sources, which is the file path for your data, and finally the host or hosts that are sending the data into Splunk.

    When creating a search where you want to get statistical information to show, before you do your calculating commands, make sure you filter the data to exactly what you are looking for. When filtering, avoid or limit using the NOT command. Try to tell Splunk what you are looking to include instead of trying to tell it what to exclude. Now, there is always the scenario where the number of what you want to include is very large. In cases like that, you can create a macro to include everything that we want to have Splunk search on, use a lookup to include all the values, or limit the number of NOTs that are used. Filtering your data to exactly what you are looking for is crucial with Splunk, as it allows Splunk to return more precise results in a quicker fashion. If there is a certain field or fields that you want to show in your search, but when you search the data a large number of fields get returned, use the fields command to tell Splunk which fields you want to bring back, so it does not bring back every single field. If you are able to limit the number of fields that Splunk brings back, it will improve the search performance.

    Search performance also includes scheduled searches, reports, and alerts. You want to make sure you do not have too many scheduled searches with the same cron schedule or scheduled time. If you have more searches than cores on your Search Head running at one time, that means that all of your SH cores are being used up. This could cause scheduled searches to be delayed or skipped and could also delay some ad hoc searches from running.

    Issue 3: High Resource Usage

    High resource usage is the final topic I wanted to discuss. There are a large number of factors that play into how well our Splunk servers are performing. If you are noticing performance issues with your Splunk servers, make sure your boxes are up to Splunk’s best practice recommendations. How well your searches are performing can also determine how well your boxes are performing. If you are running bad searches, you will notice that the CPU and memory usage of your Splunk indexers and Search Heads will increase.

    One way to check the resource usage of your Splunk boxes is to use the Monitoring Console -> Resource Usage -> Resource Usage: Instance. On this dashboard, you are able to see how much CPU and memory each of your Splunk boxes are using. I have provided a screenshot of part of this dashboard below:

    Splunk dashboard displaying line graphs of historical data over time for different data sources.

    Another factor that plays into high CPU and memory usage could be the use of Python scripts on your Splunk boxes. There are many Splunk Technical Add-ons that have Python scripts embedded in the app. If you are experiencing high CPU and memory usage, you may want to check on your server to see what processes are using up the most CPU and memory.

    Recently I have been experiencing very high CPU and memory usage due to Splunk Accelerated Data Models. If you are using Accelerated Data Models, make sure that the ones you want are the only ones that are accelerated. If you have DMAs accelerated that are not being used, it will still go through the process of running to try and complete the data model and will still use up CPU and memory. A huge tip I have for those running Enterprise Security or simply using the DMAs: disable and unaccelerate the DMAs you are not using. To permanently disable DMAs, follow the instructions below:

    Settings -> Data Inputs -> Data Model Acceleration Enforcement

    Splunk interface showing data model acceleration settings with status, enforcement options and model categories.

    Want to learn more about solving common Splunk issues? Contact us today!

  • Using the ITSI_Summary Index and Pseudo Entities to Show Overall Health Scores

    Using the ITSI_Summary Index and Pseudo Entities to Show Overall Health Scores

          By: Brent McKinney  |  Splunk Consultant

    In Splunk ITSI, you may come across times where you want to create an overall health service and need health scores from services that belong to private ITSI teams. However, once a service in ITSI belongs to a private team, it can no longer act as a dependency to a service outside its team. In these situations, you may need to manually pull health scores from the ITSI summary index as KPIs. In this blog, we will walk through a use case where we do exactly that, as well as use ITSI service names as pseudo entities to feed these KPIs. The goal here is for ITSI administrators to manually create these dependencies using the itsi_summary index, while still restricting private teams’ access to only their services.

    Use Case: Say we have 20 various applications in our environment, and we have an independent ITSI service analyzer built for each. Each application service analyzer belongs to its own private ITSI team, has a number of child services and KPIs attached, and lives in one of three AWS regions: East, West, or Central. We want to create an overall health service analyzer that solely represents the overall health of each region and the applications within it. The challenge here is that because the application services in ITSI are in private teams, we can’t simply add them as dependencies to the overall health service. We will walk through how we can use the itsi_summary index, along with pseudo entities, to achieve the same results.

    In an end state, we want to build the following Service Analyzer, with each region containing its applications as pseudo entities:

    Simple diagram showing three regional AWS nodes — West, Central, and East — feeding into a central node labeled “Overall Application Health."

    The “Overall Application Health” service will have no KPIs and simply depend on the region child services for its health score. So to begin, we can create the above four services in ITSI, and add the region services’ overall health scores as dependencies to the “Overall Application Health” service. Each region service will have one KPI, “Overall Health,” and the entities will be made up of the applications within that region.

    Now, we will begin defining this “Overall Health” KPI using a search. For this, we will need to know the health score of each application and to which region it belongs. Our goal here is as follows: Create a KPI search that pulls the overall health score of each Application, and filter each application based on region. We can achieve this by utilizing the itsi_summary index and prebuilt macros.

    Note: The itsi_summary index uses ONLY service IDs to get information on a particular service, so we’ll need to use the service_kpi_list macro to get the actual service names. This macro contains a lookup that has both the service name and ID, and will allow us to correlate and more intuitively define and filter our applications in the itsi_summary index.

    index=itsi_summary
    | join itsi_service_id
    [| `service_kpi_list`
    | search service_name = *east AND service_name=*Overall Health
    | rename serviceid as itsi_service_id
    ]
    | rename alert_value as health_score
    | table health_score service_name

    The above SPL will be used for our KPI searches and contains a sub-search. The inner search, which is run first, uses a macro to pull back a list of each service in the environment, both name and ID, along with the KPIs within each. From here, we filter to bring back the appropriate overall health score of our application and region it belongs to. (Note: This filter may differ depending on the naming convention of your services. The above is an example to filter health scores for the east region service.) We will have a unique KPI search for each region, so our goal here is to filter by region, and only grab the overall health KPI for each application. Once we have the applications we want, we can join this with the itsi_summary index in the outer search to obtain the actual health scores of those applications we returned in the inner search. In short, the inner search gives us the names of the applications we want, and the outer search correlates them to their health scores.

    Now that we’re pulling back the health scores that we need, we can define what the threshold field should be, how to split the threshold fields by application, and how to aggregate the threshold field overall. In our example, the threshold field should be “health_score.” Because the application names may not be direct data sources in your environment, but rather the names of services, we can simply define them as we did in the KPI search above, rather than import them in ITSI. Entities defined this way are referred to as “pseudo entitles,” since they exist in the KPI search but not definitively in ITSI. For this, we will choose “service_name” for “Entity Split by field.” This allows us to split and monitor the applications contributing to each region without having to manage the entities themselves in ITSI.

    For calculation, we want the latest of “health_score” as entity value and the Average of entity value as aggregate. This says that for each application, take the latest recorded health score, and for the overall health of the region, take the average of all health scores.

    We will repeat these steps for each region, editing our SPL to filter accordingly. Once these services are saved and enabled, we can see how each region is performing and contributing to the overall health of our environment, and how each application is contributing to the health of each region! This approach allows us to have applications built out in private teams in ITSI, while still allowing us to have a service that shows us ALL of the applications’ overall health scores.

    Want to learn more about the ITSI Summary and how it relates to Overall Health Scores? Contact us today!

  • Wrangling Your Splunk Indexer Storage

    Wrangling Your Splunk Indexer Storage

          By: Jon Walthour  |  Senior Splunk Consultant, Team Lead

    I have heard many customers, vexed by overflowing storage attached to their indexers, wonder why warm buckets are not rolling to a separate cold storage filesystem when they’re supposed to. Instead, their hot/warm volume on their indexers fills up and indexers are entering automatic detention because the filesystem has less than minFreeSpace MB available. They’ve reviewed their configuration in indexes.conf. They’ve set up volumes with maxVolumeDataSizeMB set to a value 90-95% the size of the filesystem on which they are storing hot and warm buckets on the indexers. And yet, the problem continues. So, they come to me asking why Splunk is broken. I tell them Splunk isn’t broken; it just doesn’t work the way they expect it to. To get accurate management of hot-warm storage, define every path by a volume, then use maxVolumeDataSizeMB to have the Volume Manager keep the size under control. Two keys:
    1. Define every “Path” using a volume. This includes:
      • – homePath
      • – coldPath
      • – summaryHomePath (for report accelerations)
      • – tsidxStatsHomePath (for data model accelerations)
    2. Create three filesystems for classic storage and two filesystems for SmartStore indexing tiers to cover all the bases:
      • – /opt/splunk – for Splunk software, logs, temp files, etc.
      • – hot/warm volume
      • – cold volume (not needed for SmartStore)
    The key that usually makes managing hot/warm storage mysterious is that most folks don’t realize that data model accelerations default to “volume:_splunk_summaries/$_index_name/datamodel_summary.” The “_splunk_summaries” volume defaults to “path = $SPLUNK_DB.” The way things get set up usually, SPLUNK_DB gets set to the same base directory as homePath. So, the data model summaries end up as a subdirectory of homePath/. However, the way the volume manager calculates storage is not “df -h,” but more like adding up all the “du -sk” calculations on all the directories where it is defined, usually homePath and coldPath. As such, datamodel summaries do not get added in and Splunk admins find that their hot/warm volumes get filled up and they can’t figure out why. Instead, define everything in the hot-warm with the hot-warm volume to get accurate management. For those settings that cannot use volume settings (e.g., thaweddb and tsidxStatsHomePath), use SPLUNK_DB and set it to a separate filesystem.

    Recommendations

    • ⁃ bloomHomePath has no default. The indexer stores bloomfilter files for the index inline, inside index bucket directories, using a small amount of storage. So it’s not worth separately defining this path as, by default, gets counted in homePath and coldPath.
    • ⁃ $SPLUNK_DB can be left to its default of $SPLUNK_HOME/var/lib/splunk or can be set to a separate filesystem. It does not need to be very large. It is used for tsidxStatsHomePath, which is an indexer-wide setting and, by default, set to $SPLUNK_DB/tsidxstats, and for thawedPath, which in most Splunk deployments is rarely used.

    indexes.conf

    [default] homePath=volume:hot-warm/$_index_name/db coldPath=volume:hot-warm/$_index_name/colddb thawedPath=$SPLUNK_DB/$_index_name/thaweddb summaryHomePath=volume:hot-warm/$_index_name/summary tstatsHomePath=volume:hot-warm/$_index_name/datamodel_summary [volume:hot-warm] path = /splunkdata/hot_warm maxVolumeDataSizeMB = ######### [volume:cold-thawed] path = /splunkdata/cold_thawed maxVolumeDataSizeMB = ######### [main] homePath = volume:hot-warm/defaultdb/db coldPath = volume:hot-warm/defaultdb/colddb thawedPath = $SPLUNK_DB/defaultdb/thaweddb summaryHomePath = volume:hot-warm/defaultdb/summary tstatsHomePath = volume:hot-warm/defaultdb/datamodel_summary maxMemMB = 20 maxConcurrentOptimizes = 6 maxHotIdleSecs = 86400 maxHotBuckets = 10 maxDataSize = auto_high_volume [history] homePath = volume:hot-warm/historydb/db coldPath = volume:hot-warm/historydb/colddb thawedPath = $SPLUNK_DB/historydb/thaweddb summaryHomePath = volume:hot-warm/historydb/summary tstatsHomePath = volume:hot-warm/historydb/datamodel_summary maxDataSize = 10 frozenTimePeriodInSecs = 604800 [summary] homePath = volume:hot-warm/summarydb/db coldPath = volume:hot-warm/summarydb/colddb thawedPath = $SPLUNK_DB/summarydb/thaweddb summaryHomePath = volume:hot-warm/summarydb/summary tstatsHomePath = volume:hot-warm/summarydb/datamodel_summary [_internal] homePath = volume:hot-warm/_internaldb/db coldPath = volume:hot-warm/_internaldb/colddb thawedPath = $SPLUNK_DB/_internaldb/thaweddb summaryHomePath = volume:hot-warm/_internaldb/summary tstatsHomePath = volume:hot-warm/_internaldb/datamodel_summary maxDataSize = 1000 maxHotSpanSecs = 432000 frozenTimePeriodInSecs = 2592000 [_audit] homePath = volume:hot-warm/audit/db coldPath = volume:hot-warm/audit/colddb thawedPath = $SPLUNK_DB/audit/thaweddb summaryHomePath = volume:hot-warm/audit/summary tstatsHomePath = volume:hot-warm/audit/datamodel_summary [_thefishbucket] homePath = volume:hot-warm/fishbucket/db coldPath = volume:hot-warm/fishbucket/colddb thawedPath = $SPLUNK_DB/fishbucket/thaweddb summaryHomePath = volume:hot-warm/fishbucket/summary tstatsHomePath = volume:hot-warm/fishbucket/datamodel_summary maxDataSize = 500 frozenTimePeriodInSecs = 2419200 # this index has been removed in the 4.1 series, but this stanza must be # preserved to avoid displaying errors for users that have tweaked the index's # size/etc parameters in local/indexes.conf. # [splunklogger] homePath = volume:hot-warm/splunklogger/db coldPath = volume:hot-warm/splunklogger/colddb thawedPath = $SPLUNK_DB/splunklogger/thaweddb disabled = true [_introspection] homePath = volume:hot-warm/_introspection/db coldPath = volume:hot-warm/_introspection/colddb thawedPath = $SPLUNK_DB/_introspection/thaweddb summaryHomePath = volume:hot-warm/_introspection/summary tstatsHomePath = volume:hot-warm/_introspection/datamodel_summary maxDataSize = 1024 frozenTimePeriodInSecs = 1209600 [_telemetry] homePath = volume:hot-warm/_telemetry/db coldPath = volume:hot-warm/_telemetry/colddb thawedPath = $SPLUNK_DB/_telemetry/thaweddb summaryHomePath = volume:hot-warm/_telemetry/summary tstatsHomePath = volume:hot-warm/_telemetry/datamodel_summary maxDataSize = 256 frozenTimePeriodInSecs = 63072000 [_metrics] homePath = volume:hot-warm/_metrics/db coldPath = volume:hot-warm/_metrics/colddb thawedPath = $SPLUNK_DB/_metrics/thaweddb summaryHomePath = volume:hot-warm/_metrics/summary tstatsHomePath = volume:hot-warm/_metrics/datamodel_summary datatype = metric #14 day retention frozenTimePeriodInSecs = 1209600 metric.splitByIndexKeys = metric_name # Internal Use Only: rollup data from the _metrics index. [_metrics_rollup] homePath = volume:hot-warm/_metrics_rollup/db coldPath = volume:hot-warm/_metrics_rollup/colddb thawedPath = $SPLUNK_DB/_metrics_rollup/thaweddb summaryHomePath = volume:hot-warm/_metrics_rollup/summary tstatsHomePath = volume:hot-warm/_metrics_rollup/datamodel_summary datatype = metric # 2 year retention frozenTimePeriodInSecs = 63072000 metric.splitByIndexKeys = metric_name

    Want to learn more about managing your Splunk Indexer storage? Contact us today!

  • How to Forward Data to Splunk Cloud: Architecture Options and Step-by-Step Instructions

    How to Forward Data to Splunk Cloud: Architecture Options and Step-by-Step Instructions

          By: Forrest Lybarger & Khristian Pena  |  Splunk Consultants

    Implementing Splunk Cloud prompts teams to make many decisions about their environment, from hardware specs to compliance standards. One of the big questions a team must answer is, “How will data be sent from devices like workstations and domain controllers to Splunk Cloud?” But that is more complicated than it may seem. Besides the niche forwarding methods (i.e. Splunk Stream App, which usually is mandatory for whatever data will use it), there are 3 options for forwarding data: directly via universal forwarder (UF), indirectly via intermediate forwarder (IF), or directly via a heavy forwarder (HF). Each of these methods has pros and cons that will be covered here, so anyone moving to Splunk Cloud can make a decision on how they will forward data. These strategies also aren’t mutually exclusive; they can be mixed and matched depending on individual circumstances.

    Option 1: Send Data to the Splunk Cloud via a Universal Forwarder

    A flowchart with three tan boxes connected to a brick firewall icon. The firewall icon is connected to a cloud icon.

    The first and simplest option is to send data directly from source hosts to Splunk Cloud via a UF. This approach doesn’t require any additional hardware (unless a deployment server is used) and has no single point of failure. UFs are installed on every source host and are configured with the environment-specific Splunk Cloud Forwarding app (downloadable from every Splunk Cloud Web UI). Problems emerge when considering the connection between the source hosts and Splunk Cloud. Firewall rules will need to be mended in order to allow outbound traffic from source hosts. With a small environment, this ask is easy to implement and maintain, but once the environment scales up, there can be thousands of firewall rules to maintain. The cut off for when this option is viable will depend on the customer, but in general this set up is best for small environments.

    Option 2: Send data to the Splunk Cloud via an Intermediate Forwarder

    A flowchart depicting how an intermediate forwarder can be used to send data to the Splunk Cloud.

    The second option is to send data to an intermediate forwarder before sending to Splunk Cloud. The intermediate forwarder will need to be on its own server in order to have the resources for processing large amounts of data. It is highly recommended to have at least two IFs to prevent a single point of failure (Splunk can load balance between IFs without a dedicated load balancer). IFs use the same software as UFs, so they are very lightweight and perform minimal processing. The main benefit of this Splunk architecture is to minimize firewall holes. With this approach, only the IFs will need special firewall rules maintained for them. You can also send heavy forwarder data through these IFs, though that will increase network load due to the increased size of parsed data. Another consideration with this plan is data transmission between data centers. If such a thing is not allowed, there will need to be IFs in every datacenter where there are UFs, and planning must happen to send data to the correct IF. Overall, this option is more scalable than the first, but requires more hardware and coordination.

    Option 3: Send Data to the Splunk Cloud via a Heavy Forwarder

    A flowchart depicting how a heavy forwarder can be used to send data to the Splunk Cloud.

    Finally, data can be sent to a heavy forwarder (HF) before going to Splunk Cloud. Similar to the previous option, the HF acts as an intermediary that requires its own hardware. The big change from the previous architecture is that the HF is a full Splunk instance and parses data sent through it. Parsed data will be significantly larger than unparsed data causing more network load, but will reduce load on indexers in Splunk Cloud and is necessary for some data (individual data source documentation will note if HFs are required). Two or more HFs are recommended to prevent a single point of failure. Like the previous option, this is more scalable than the first option, but requires more hardware and coordination.

    In conclusion, the three architectures have their own purposes and can be used in tandem to fulfill each customer’s specific needs. For small environments where firewall management isn’t a problem, sending data directly from source hosts to Splunk Cloud is a viable option with limited extra expenditure. For larger environments, a mix of the other two methods is best. When there’s data that needs an HF, use the third approach. Use the second approach for other data to avoid excessive firewall rules. Whether or not to forward the HF data through an IF is up to the individuals. Doing so will use more network bandwidth, but sending to Splunk Cloud from the HF will require more firewall rules.

    Forwarder Configuration to Splunk Cloud

    Regardless of which architecture your organization decides to go with for sending local data to Splunk Cloud, you will need to install the Splunk Universal Forwarder software from your Cloud Deployment. The package is called Splunk Universal Forwarder Credentials, but you are able to install this app on your UFs as well as your HFs.

    The Universal Forwarder Credentials file contains a custom certificate for your Splunk Cloud Deployment.

    Download the Splunk Universal Forwarder Credentials:

    1. In your Splunk Cloud instance, got to Apps > Universal Forwarder.
    2. Click Download Universal Forwarder Credentials.
    3. Note the location of the downloaded file; it will be named splunkclouduf.spl.
    4. Copy the file to your /tmp folder on the instance that will be receiving the credentials or to your Deployment server.
    A screenshot of the Splunk Cloud app illustrating where the Universal Forwarder Credentials can be accessed and downloaded.

    Install the forwarder credentials on individual forwarders.

    (We recommend managing all forwarders from your Deployment Server vs. manually updating each instance.)

    This will only apply if you do not use a Deployment Server to manage your forwarders.

    1. Install the following app on your forwarder by running this command: /opt/splunkforwarder/bin/splunk install app /tmp/splunclouduf.spl
    2. When you are prompted for a login, use the user name and password for the Universal Forwarder instance. The following message will display when you have successfully installed the credentials package: App ‘/tmp/splunkcloud.spl’ installed.
    3. Restart the forwarder: /opt/splunkforwarder/bin/splunk restart

    Want to learn more about forwarding data to the Splunk Cloud? Contact us today!

  • Troubleshooting In Splunk

    Troubleshooting In Splunk

          By: David Allen  |  Senior Splunk Consultant

     

    Like many things in life, having the right tools to fix a problem is what separates the novice from the expert. The novice has almost no tools in their toolbox, and the tools that they have are large and clunky. Whereas the expert has many tools which have been refined over many years of experience fixing many problems. Without the correct tools for the job, many tasks simply could not be accomplished — or at least would become much more difficult and time-consuming. Understanding what tools are available to fix and troubleshoot common Splunk Enterprise problems and how to use those tools — at a macro level — is the purpose of this blog.

    The first tool need you will as you begin your Splunk troubleshooting journey is some basic knowledge on how to troubleshoot and how to narrow down all the possibilities, like peeling off layers of an onion until eventually you find the root cause of the problem. Some problems we see over and over and have learned to do a couple of simple checks to solve the problem. How many times have you run a search and said to yourself, “Where are all my fields?” We quickly learned to check the search modem and make sure if you want fields to be in Verbose mode or to a lesser extent Smart mode.

    Search Job Inspector

    The first tool you will need for troubleshooting basic searching problems is the Splunk Search Job Inspector. If you suspect that your search is not working properly, then using the Search Job Inspector may shed some light on the issue. The Search Job Inspector is a tool that lets you take a closer look at what your search is doing and see where the Splunk software is spending most of its time.

    You can access the Job Inspector by clicking the dropdown to the left of the search mode.

    A screenshot of the Splunk app showing options for the Search Job Inspector dropdown.

    From the dropdown, select “Inspect Job.” You will see another screen containing Execution Costs details and Search Job Properties details. Also note the amount of time it took to complete the search, which may be a symptom of a problem you are not even aware of yet!

    A screenshot of the Splunk Search Job Inspector menu.

    Execution Costs

    The Execution Costs section lists information about the components of the search and how much impact each component has on the overall performance of the search.

    • – The component durations in seconds.
    • – How many times each component was invoked while the search ran.
    • – The input and output event counts for each component.

    With the information in the Execution Costs section, you can troubleshoot the efficiency of your search. You can narrow down which processing components are impacting the search performance.

    Search Job Properties

    The Search Job Properties section contains a list of many fields with additional search parameters. The most important fields for troubleshooting are the following:

    • eventCount: The number of events returned by the search.
      eventFieldCount: The number of fields found in the search results.
      eventIsTruncated: Indicates that events have not been stored and not available for search.
      isDone: Indicates if the search has completed.
      isFailed: Indicates if there was a fatal error executing the search.
      isFinalized: Indicates if the search was finalized (stopped before completion).
      runDuration: Time in seconds that the search took to complete.

    You also have access to the search.log link on the far right which opens the search.log where you can search for errors and warnings which may give a clue as to the search issue you are experiencing.

    But for more complex SPL (Search Programming Language) problems, ask yourself some basic questions:

    • – When did this start happening?
    • – What is the exact thing I am searching for and what is the time range?
    • – Have I added a lookup file or event type incorrectly?

    Then remove lines of SPL and add them back one line at a time and find the line where the problem shows up. Then unravel the problematic line piece by piece until you find the problem.

    The above example works fine for basic search problems, but for Enterprise problems, you are going to need some more powerful tools in your toolbox.

    BTOOL

    Splunk uses configuration files for almost all the settings within it. These .conf files are scattered all over the directory structure in many similarly-named .conf files. Splunk combines these similarly named files lexicographically and by a defined precedence order. To complicate things further, Splunk needs to be reset to reload the latest changes to the .conf files. If you think that Splunk is not using the configurations that it should, then BTOOL is your tool of choice.

    BTOOL is a Splunk CLI command which shows what the actual settings are on the disk, or most likely SSD these days – not what is in memory and maybe not what Splunk is currently running, so beware of this subtle fact. To be sure you are seeing the config settings Splunk is actually running, you will need to restart Splunk. To access this command be sure to be at the Splunk home directory: $SPLUNK_HOME/bin.

    BTOOL comes with Splunk Enterprise software, so no additional purchase, download, or installation is needed.

    Below is the typical BTOOL command syntax (Note: All CLI commands in this document are typical for *nix OS):

    ./splunk btool list [options]

    Here are some examples of the most common BTOOL commands:

    To display all the merged settings of the various inputs.conf files, run this command:

    ./splunk btool inputs list –-debug

    Or you may want to see all input configurations contained in the search app:

    ./splunk btool –app=search inputs list

    Or you may want to see all props configurations set in the search app, and in what context they are set:

    ./splunk btool props list –app=search --debug

    Lastly, you may want to find an input stanza for which you know name:

    ./splunk btool inputs list | grep splunktcp

    Splunk Log Files

    Under the hood, Splunk is running a lot of processes, from ingesting data to searching data and a lot more. All of these processes, and many of the steps in between, generate data that the Splunk software records into log files. Analyzing these log files can give clues to help solve your Splunk problem. The most common logs used for troubleshooting in Splunk are the internal logs located in: $SPLUNK_HOME/var/log. This path is monitored by default, and the contents are sent to various indexes based upon the type of log file. The most common internal indexes are _introspection, _internal, and _audit.

    The _introspection index collects data about the impact of the Splunk software on the host system.
    It specifically collects the OS resource usage for Splunk processes, which can be broken down by Splunk process and viewed by host-level, dynamic CPU utilization and paging information. This index also contains disk input-output usage statistics. This can be very useful in diagnosing Splunk performance issues.

    For example, use this search to find the median CPU usage of the main Splunkd process for one host over the last hour:

    index=_introspection component=PerProcess host= data.process=splunkd
    data.args="-p * start" OR data.args="service") earliest=-1h
    | timechart median(data.pct_cpu) as cpu_usage(%)

    _internal: This index includes Splunk Enterprise internal logs. This index can be used to check the flow of data through the various pipeline processes, data about license usage, the search scheduler, various Splunk crash logs, various search information, and more.

    For instance, to search for the size of the search artifacts, use this search:

    index=_internal sourcetype=splunkd_access method=GET jobs
    |stats sum(bytes) by uri

    The _audit indexes contain information about user activities such as failed or successful user log ins, modified settings, updated lookup files. Running searches, capability checks, and configuration changes generate audit events.

    For example, to audit user access use this search:

    index="_audit" action=log* action="login attempt"

    One of the most common log files used for troubleshooting is the splunkd.log, which uses source type Splunkd and is indexed to the _internal index. The Splunkd source type is further broken down by component, so you can further refine your search by its subcategory. Using the source type Splunkd, you can use a search like this to check for any data quality warnings or errors:

    index=_internal sourcetype=splunkd (component=AggregatorMiningProcessor OR
    component=LineBreakingProcessor OR component=DateParserVerbose)
    (log_level=WARN OR log_level=ERROR)

    Or to check for potential index issues, you can use a search like this one:

    index=_internal sourcetype=splunkd host=idx*.yourcompany.splunkcloud.com
    component=metrics group=per_*_regex_cpu

    Splunk generates many internal log files, and searching those internal logs is a good way to find or isolate many common Splunk Enterprise problems.

    Health Report Manager – New in Splunk Version 8.0.0

    The Health Report Manager is a high-level overview of your Enterprise and lets you view the status of various Splunk Enterprise components. Individual components report their health status every 30 seconds and results are displayed through a tree structure that provides a continuous, real-time view of the health of your deployment.

    The Health Report Manager can be accessed here:

    A screenshot of Splunk Enterprise showing where users can access the Health Report Manager feature.

    Once selected, the dropdown appears as shown below and displays the health of the various components. Check this if you suspect there may be an issue with your Enterprise or if the indicator is not green.

    A screenshot showing the Health Status of Splunkd report.

    How the Splunk Health Report Works

    The health report records the health status of Splunk features in a tree structure, where leaf nodes represent particular features, and intermediary nodes categorize the various features. Feature health status is color-coded in four states as follows:

    • – Green: The feature is functioning properly.
    • – Yellow: The feature is experiencing a problem.
    • – Red: The feature has a severe issue and is negatively impacting the functionality of your deployment.
    • – Grey: Health report is disabled for the feature.

    Let’s run through a scenario of how we could find the problem if the Searches Skipped indicator is red.

    1. First, select the Searches Skipped feature to view diagnostic information about the current health status of the feature.
    2. Review the information under Root Cause. In this case, the percentage of high priority searches skipped is 44% over the last 24 hours, which exceeds the red threshold of 10% and causes the feature’s health status to change to red.
    3. Review the Last 50 Related Messages. These log entries include warning messages showing that some scheduled searches cannot be executed. For example: 09-15-2020 16:11:00.324 +0000 WARN SavedSplunker - cannot execute scheduled searches that live at the system level (need an app context).

    One explanation for this type of warning message is the possibility that the number of high-priority searches running exceeds the maximum concurrent search limit, which can cause searches to be skipped.

    After you review the root cause and log file information, which suggest that maximum search concurrency limits caused the Searches Skipped feature’s status change, you can use the Cloud Monitoring Console to check search scheduler activity and confirm if the suspected cause is correct.

    • – In Splunk Web, click Apps > Cloud Monitoring Console.
    • – Click Search > Scheduler Activity. The Count of Scheduler Executions panel shows that 43.62 % of searches have been skipped over the last 4 hours, which approximates the percentage of skipped searches reported under root cause in the health report.
      A screenshot of the Splunk App showing number of skipped searches.
    • – Click Search > Skipped Scheduled Searches. The Count of Skipped Scheduled Searches panel shows that 756 searches have been skipped over the last 4 hours because “the maximum number of concurrent historical searches on this instance has been reached.” This confirms that the cause of the Skipped Searches status change is that the maximum concurrent search limit has been reached on the system.
      A screenshot of the Count of Skipped Scheduled Searches report showing that the maximum number of scheduled searches has been reached.
    • – You can now take steps to remedy this issue by decreasing the total number of concurrent scheduled searches running and increasing the relative concurrency limit for scheduled searches, which can bring the number of concurrent searches below the maximum concurrent search limit, and return the Searches Skipped feature to the green state.

    DIAG

    A diag file provides a snapshot of the configurations and logs from the Splunk software along with select information about the platform instance. The diag collection process gathers information such as server specifications, operating system (OS) version, file system information, internal logs, configuration files, and current network connections. No customer data is included in the diag file.

    In your troubleshooting quest using the CLI from the $SPLUNK_HOME/bin folder, run the following command for each instance that you are troubleshooting:

    ./splunk diag

    If you do contact Splunk regarding an issue, they will often request a diag file for their analysis. You can even index the diag output file and “Splunk it” and create your own troubleshooting dashboards!

    To generate and upload a diag, the CLI syntax is:

    ./splunk diag --upload

    This command interactively prompts for values such as a Splunk username and password, choice of open cases for that user, and a description of the upload.

    You can also remove certain components form the diag report with a command as follows:

    ./splunk diag -collect=

    Likewise, components can be removed with this command:

    ./splunk diag -disable=

    Using Telnet to Test Open Ports

    When it comes to checking if a network port is opened or closed on a remote computer, there’s no easier way than to use Telnet. Ports that are left open for no reason are a security risk that can be exploited by malicious programs and viruses. At the same time, if a legitimate software communicates through a certain port, having that port closed will make the program throw errors and malfunction. Telnet allows the user to test individual ports and see whether they are open or not.

    On a *nix OS box, you can run the Telnet command through the terminal as shown below:

    telnet [domainname or ip] [port], e.g.>telnet 192.168.1.1 443

    When a computer port is open a blank screen will show up, meaning that the connection has been successful. An unsuccessful connection will be accompanied by an error message.

    Many times when you try to use Telnet, you may find that your own network is blocking your connection. It’s quite common for users to be running a firewall, which blocks connection to outbound ports. A basic way to test whether your firewall is interrupting your Telnet is to disable your firewall and run a Telnet test.

    Network Toolkit

    This is an app on Splunkbase. The Network Toolkit app provides a series of tools for troubleshooting networks. It includes tools for evaluating internet connection bandwidth, performing pings, traceroutes, DNS lookups, whois record checks, and waking sleeping computers (via wake-on-lan).

    Additional Online Resources for Splunk Troubleshooting

    The Splunk How-To YouTube Channel
    Splunk Online Documentation
    Online Troubleshooting Manual
    Splunk Answers
    Submitting a case to Splunk

    Want to learn more about data model accelerations? Contact us today!

  • Website Content Access Control by Geolocation

    Website Content Access Control by Geolocation

          By: Stuart Arnett  |  Principal Architect

    A public facing website in general is accessible to the entire world. However, there might be times when you want to allow or restrict content based on the geolocation of the user accessing the site. There are several reasons for wanting to do this, but the following are some examples:

    • – Security – restrict access to the website based on country (ex., only United States users can access the website or all countries except China can access the website)
    • – Translations – automatically display the website using the primary language for the country the user is located in
    • – Targeted Content – display different content to the end user, (ex., redirect the user to country specific domains of the website or provide access to different pages)

    To perform any of the above scenarios, the web server will need to know the geolocation of the user. This is accomplished by using the user’s IP address. This poses a problem because the location for an IP addresses can change when IP addresses are re-assigned. Luckily for us, MaxMind, Inc. (https://www.maxmind.com) provides GeoIP databases and services. The GeoIP databases / services are available in both free and paid for versions. The free versions are not as accurate as the paid for versions and only provide country, city, and ASN databases. We will be focusing on the free version of the GeoIP databases.

    MaxMind also provides tools to keep the databases updated and a module for Apache HTTP server to query the databases to determine the user’s country, city, and/or ASN data. We will be setting up both the GeoIP database update tool and configuring Apache HTTP server module in the demo.

    Demo Environment

    We will be using the following for setting up the demo:

    • – Operating System: Amazon Linux 2
    • – Web Server: Apache HTTP Server 2.4
    • – Geolocation: MaxMind GeoLite2 Databases, MaxMind GeoIP Update, and MaxMind DB Apache Module

    MaxMind Account Setup

    MaxMind requires you to setup an account and create a license key to access the MaxMind GeoLite2 databases.

    1. Navigate to https://www.maxmind.com/en/geolite2/signup and setup a new account.
    2. Once your account is set up, navigate to https://www.maxmind.com/ to create a new license key for GeoIP Update versions older than 3.1.1.

    Note: Make sure to copy the license key, because it is not accessible after you leave the creation page.

    Install and Configure MaxMind

    We will now install MaxMind databases, update application, and the Apache HTTP module on Apache Linux 2.

    1. Log into your Apache Linux 2 instance. You will need an account with root access.
    2. Enable the EPEL repository on Amazon Linux 2 to access the MaxMind packages. sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    3. Install MaxMind databases and development libraries using the following command:
      sudo yum install -y libmaxminddb-devel

    4. Amazon Linux 2 already includes an older version of the MaxMind GeoIP Update package (GeoIP) which will work but does not meet MaxMind’s latest security requirements. A request has been added to the AWS update backlog to update the package. The installed version will be used for this demo, but the configuration below will change when Amazon upgrades to the newer version.
    5. Update the MaxMind GeoIP Update configuration in /etc/GeoIP.conf
      sudo vi /etc/GeoIP.conf
      Update the UserId and LicenseKey information with your MaxMind Account ID and License Key created during your MaxMind account setup above. Update the ProductIds with the values specified below (GeoLite2-ASN GeoLite2-City GeoLite2-Country). The Product IDs are used to determine which databases will be updated. # Enter your license key here

      # customers should insert their license key and user_id

      # free GeoLite users should use 000000000000 as license key

      LicenseKey 000000000000

      # Enter your User ID here ( GeoLite only users should use 999999 as user_id )
      UserId 999999# Enter the Product ID(s) of the database(s) you would like to update
      # By default 106 (MaxMind GeoIP Country) is listed below
      ProductIds GeoLite2-ASN GeoLite2-City GeoLite2-Country
    6. Update the MaxMind GeoIP Databases.
      /usr/bin/geoipupdate -v The -v command line option is used for verbose mode to provide some output when running the update. For future reference, the database files are stored in the “/usr/share/GeoIP/” folder.
    7. MaxMind updates the GeoIP databases on Tuesdays US Eastern time. Configure a crontab job to execute the geoipupdate program on Wednesdays to keep the databases updated with the latest information. crontab -e
      Add the following line to run the job on Wednesdays at 4am UTC.

      Note:
      Adjust the time accordingly based on the time zone for your server.



      00 04 * * 3 sudo /usr/bin/geoipupdate
    8. Install the MaxMind Apache HTTP Module using the following commands: sudo yum install -y gcc

      sudo yum install -y httpd-devel
      mkdir ~/download/
      cd ~/download
      wget https://github.com/maxmind/mod_maxminddb/releases/download/1.2.0/mod_maxminddb-1.2.0.tar.gz

      tar xvzf mod_maxminddb-1.2.0.tar.gz

      cd mod_maxminddb-1.2.0
      ./configure
      sudo make install


      The above commands install the gcc and httpd-devel packages which are required to build the mod_maxminddb Apache HTTP module. The module tarball is downloaded, built, and installed which adds the library to the Apache HTTP modules folder and updates the httpd.conf including the new library.

    Install and Configure Apache HTTP Server

    We now need to setup and configure Apache HTTP Server.

    1. Log into your Apache Linux 2 instance. You will need an account with root access.
    2. Install Apache HTTP Server using the following command:
      sudo yum install -y httpd
    3. Start the Apache HTTP Server and verify it is working by navigating to your server with a web browser. Make sure the Apache Test page is displayed.
      sudo systemctl start httpd
    4. Create a new httpd configuration file with the MaxMind configuration:
      sudo vi /etc/httpd/conf.d/geolocation.confAdd the following to the file:


      <VirtualHost *:80>

      <IfModule mod_maxminddb.c>

      MaxMindDBEnable On
      MaxMindDBFile ASN_DB /usr/share/GeoIP/GeoLite2-ASN.mmdb
      MaxMindDBFile CITY_DB /usr/share/GeoIP/GeoLite2-City.mmdb
      MaxMindDBFile COUNTRY_DB /usr/share/GeoIP/GeoLite2-Country.mmdb
      MaxMindDBEnv GEOIP_ASN ASN_DB/autonomous_system_number
      MaxMindDBEnv GEOIP_ASORG ASN_DB/autonomous_system_organization# MaxMindDBEnv GEOIP_CONTINENT_CODE CITY_DB/continent/code
      # MaxMindDBEnv GEOIP_CONTINENT_NAME CITY_DB/continent/names/en
      # MaxMindDBEnv GEOIP_COUNTRY_CODE CITY_DB/country/iso_code
      # MaxMindDBEnv GEOIP_COUNTRY_NAME CITY_DB/country/names/en
      MaxMindDBEnv GEOIP_CITY_NAME CITY_DB/city/names/en
      MaxMindDBEnv GEOIP_LONGITUDE CITY_DB/location/longitude
      MaxMindDBEnv GEOIP_LATITUDE CITY_DB/location/latitude
      MaxMindDBEnv GEOIP_CONTINENT_CODE COUNTRY_DB/continent/code
      MaxMindDBEnv GEOIP_CONTINENT_NAME COUNTRY_DB/continent/names/en
      MaxMindDBEnv GEOIP_COUNTRY_CODE COUNTRY_DB/country/iso_code
      MaxMindDBEnv GEOIP_COUNTRY_NAME COUNTRY_DB/country/names/en
      RewriteEngine OnRewriteCond %{REQUEST_URI} !^/geoip.html$
      RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$
      RewriteRule .* /geoip.html?continentCode=%{ENV:GEOIP_CONTINENT_CODE}&continent=%
      {ENV:GEOIP_CONTINENT_NAME}&countryCode=%{ENV:GEOIP_COUNTRY_CODE}&country=%{ENV:GEOIP_COUNTRY_NAME}&city=%{ENV:GEOIP_CITY_NAME}&lat=%{ENV:GEOIP_LATITUDE}&long=%{ENV:GEOIP_LONGITUDE}&asn=%{ENV:GEOIP_ASN}&asorg=%{ENV:GEOIP_ASORG} [R,L]

      </IfModule>

      </VirtualHost>
      • – MaxMindDBEnable is used to enable or disable the MaxMind DB Apache Module.


        MaxMindDBEnable On|Off
      • – MaxMindDBFile is used to associate a name to a MaxMind database file on disk.


        MaxMindDBFile <Name> <Filesystem Path to Database File>
      • – MaxMindDBEnv is used to assign a database value to an environment variable. It will look up the database value based on the IP address making the current request.


        MaxMindDBEnv <ENV Variable Name> <Database Name><Path to Data>
      • – Environment variable values are accessed using the following syntax:


        %{ENV:<ENV Variable Name>}

        An Apache rewrite condition (RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$) is used in the above configuration to redirect all United States users accessing the website to the geoip.html page. The query parameters appended to the URL are used to display the additional data that is available within the MaxMind GeoLite2 database files and is for reference only.Note: If you are located outside of the United States, please update the country code accordingly to be able to verify the solution is working when you test.
    5. Create HTML file geoip.html


      sudo vi /var/www/html/geoip.html
      Add the following to the file:<h1>Geolocation Test Page</h1>
    6. Restart the Apache HTTP Server to load the new configuration.


      sudo systemctl restart httpd
    7. Navigate to the root page of your website. Assuming your IP is within the United States, you will be redirected to the geoip.html page. Review the query parameters added to the URL to view the additional data that is available within the MaxMind GeoLite2 database files based on your IP address.

    You should now have a working website which allows geolocation-based rules to be applied to direct traffic. You can use this as a base and modify the configuration adding any additional rules you require for the geolocation business requirements in your website.

    Want to learn more about geolocation rules and exclusions? Contact us today!

  • Accelerating Data Modeling: Expert Tips

    Accelerating Data Modeling: Expert Tips

          By: Jon Walthour  |  Senior Splunk Consultant, Team Lead

    • – Common Information Model (CIM)
    • – DBX Health Dashboards
    • – Palo Alto app
    • – Splunk Global Monitoring Console
    • – Infosec
    • – CIM Validator
    • – CIM Usage Dashboards
    • – ArcSight CEF data models add-on
    • – SA-Investigator
    • – Threat hunting
    All these Splunk apps and add-ons and many others use data models to power their searches. In order for a data model-powered search to function at peak performance, they are often accelerated. This means that at regular, frequent intervals, the searches that define these data models are run by Splunk and the results are summarized and stored on the indexers. And, because of the design of data models and data model accelerations, this summarized data stored on the indexers is tied to the search head or search head cluster that created it. So, imagine it: You’re employing many different apps and add-ons in your Splunk deployment that all require these data models. Many times you need the same data models accelerated on several different search heads for different purposes. All these data models on all these search heads running search jobs to maintain and keep their summarized data current. All this summarized data is stored again and again on the indexers, each copy of a bucket’s summary data identical, but tied to a different search head. In a large distributed deployment with separate search heads or search head clusters for Enterprise Security, IT Service Intelligence, adhoc searching, etc., you end up accelerating these data models everywhere you want to use them—on each search head or search head cluster, on your Monitoring Console instance, on one or more of your heavy forwarders running DB Connect, and more. That’s a lot of duplicate searches consuming CPU and memory on both your search heads and your indexers and duplicate accelerated data-consuming storage on those indexers. There is a better way, though. Beginning with version 8.0, you can now share data models across instances—run once, use everywhere in your deployment that uses the same indexers. You accelerate the data models as usual on Search Head 1. Then, on Search Head 2, you direct Splunk to use the accelerated data created by the searches run on Search Head 1. You do this in datamodel.conf on Search Head 2 under the stanzas for each of the data models you want to share by adding the setting “acceleration.source_guid” like this: [<data model name.] acceleration.source_guid = guid of Search Head 1 You get the GUID from one of two places. If a standalone search head created the accelerated data, the GUID is in $SPLUNK_HOME/etc/instance.cfg. If the accelerated data was created by data model searches run on a search head cluster, you will find the GUID for the cluster in server.conf on any cluster member in the [shclustering] stanza. That’s it, but there are a few “gotchas” to keep in mind. First, keep in mind that everything in Splunk exists in the context of an app, also known as a namespace. So, the data models you’re accelerating are defined in the context of an app. Thus, the datamodel.conf you’re going to have on the other search heads with the “acceleration.source_guid” setting must be defined in the same namespace (the same app) as the one in which the data model accelerations are generated on the originating search head. Second, once you set up this sharing, you cannot edit the data models on the search heads sharing the accelerated data (Search Head 2, in our example above) via Splunk web. You have to set up this sharing via the command line, and you can only edit it via the command line. You will also not be able to rebuild the accelerated data on the sharing search heads for obvious reasons, as they did not build the accelerated data in the first place. Third, as with all other things in multisite indexer clusters, sharing data model accelerations in multisite indexer clusters gets more complicated. Basically, since the summary data hitches a ride with the primary buckets in a multisite deployment, which end up being spread across the sites, while search heads get “assigned” to particular sites, you want to set “summary_replication” to “true” in the [clustering] stanza in server.conf. This ensures that every searchable copy of a bucket, not just the primary bucket, has a copy of the accelerated data and that searches of summary data are complete. There are other ways to deal with this issue, but I’ve found simply replicating the accelerated data to all searchable copies ensures no missing data and no duplicate data the best. Finally, when you’re running a tstats search against a shared data model, always use summariesonly=true. Again, this ensures a consistent view of the data as unsummarized data could introduce differing sources and thus incorrect results. One way to address this is to ensure the definition of the indexes that comprise the sources for the data models in the CIM (Common Information Model) add-on are consistent across all the search heads and search head clusters. And this leads us to the pièce de résistance, the way to take this feature to a whole new level: Install a separate data model acceleration search head built entirely for the purpose of running the data model accelerations. It does nothing else, as in a large deployment, accelerating all the data models will keep it quite busy. Now, this means this search head will need plenty of memory and plenty of CPU cores to ensure the acceleration search jobs run smoothly, quickly, and do not queue up waiting for CPU resources or, worse yet, get skipped altogether. The data models for the entire deployment are managed on this job server. They are all accelerated by this instance and every other search head and search head cluster has a datamodel.conf where all data model stanzas have an “acceleration.source_guid” setting pointing to this data model job search head. This gives you two big advantages. First, all the other search heads and clusters are freed up to use the accelerated data models without having to expend the resources to maintain them. It separates the maintenance of the data model accelerations from the use of them. Even in an environment where only one search head or search head cluster is utilizing these accelerated data models, this advantage alone can be significant. So often in busy Enterprise Security implementations, you can encounter significant skipped search ratios because regularly run correlation searches collide with regularly run acceleration jobs and there just aren’t enough host resources to go around. By offloading the acceleration jobs to a separate search head, this risk of data model content loss because of skipped accelerations or missed notable events because of skipped correlation searches is greatly diminished. Second, since only one instance creates all the data models, there is only one copy of the summary data on the indexers, not multiple duplicate copies for various search heads, saving potentially gigabytes of disk space. And, since the accelerations are only run once on those indexers, indexer resources are freed up to handle more search load. In the world of medium and large distributed Splunk deployments, Splunk instances get specialized—indexers do indexing, search heads do searching. We also often have specialized instances for the Monitoring Console, the Cluster Manager, the Search Head Cluster Deployer, and complex modular inputs like DBConnect, Splunk Connect for Syslog, and the AWS add-ons. The introduction of Splunk Cloud has brought us the “Inputs Data Manager,” or IDM, instance for these modular inputs. I offer to you that we should add another instance type to this repertoire—the DMA instance to handle all the data model accelerations. No decently-sized Splunk deployment should be without one.

    Want to learn more about data model accelerations? Contact us today!