Category: Splunk

  • What is a SOC and Why Is It Essential for Proactive Threat Detection and Response?

    What is a SOC and Why Is It Essential for Proactive Threat Detection and Response?

    A command center overseeing security issues is at the heart of an organization’s operations. This security operations center (SOC) employs a team of cybersecurity experts, technology, and processes to protect a company from cyber attacks.

    But what is a SOC in cybersecurity? Like a gatekeeper, this centralized unit monitors an organization’s networks, servers, and endpoints 24/7, gathers threat intelligence, deals with incidents, minimizes damage, and provides security reports for compliance. In short, the SOC detects, responds, and protects an organization from cyber threats that can curtail business continuity.

    Cyberattacks constantly evolve and have become serious threats to businesses, plaguing all sectors. Any organization’s security relies on a strong SOC, meaning business leaders need to prioritize this approach to improve their cybersecurity posture and manage security incidents. Keep reading to learn more.

    Core Functions of a Security Operations Center

    As it becomes increasingly challenging to keep data safe, a security operation center helps you stay vigilant by detecting, assessing, and managing cyberattacks through data analysis. The SOC team collects data from firewalls, intrusion prevention and detection systems, and SIEM systems. If it detects suspicious activity, it alerts the team, who then responds.

    Let’s look at each function in more detail.

    Monitoring and Detection

    The SOC operates around the clock, utilizing various advanced tools to monitor networks, servers, endpoints, devices, and applications for signs of unusual activity or breaches. It analyzes logs and real-time data from firewalls and SIEM systems. Through SIEM, the SOC gathers data from different sources and analyzes security activities, which expedites detection.

    Incident Response

    The incident response process begins by identifying a potential threat. Security analysts get alerts and assess the nature and severity of the incident, identifying indicators of compromise to confirm whether the event qualifies as a security incident.

    Once they confirm it’s a real threat, they quickly isolate affected systems to prevent further damage. The isolation may involve stopping the intrusion and disconnecting compromised devices from the network.

    Analysts use Security Orchestration, Automation, and Response (SOAR) tools to automate repetitive tasks such as alert triaging and incident response. This helps to both reduce response times and ensure the process has no human error. SOAR tools integrate various security tools into a single console, from which security teams manage alerts and incidents without switching between different systems. The centralization reduces the time they spend on manual processes, speeding up response.

    The next step is removing the threat, such as malware or unauthorized access, from the environment by applying patches or updates to secure vulnerabilities. Once the threat is neutralized, the analysts restore systems to normal operations using backups to recover lost data while ensuring that the backups have no remnants of the threat.

    It doesn’t stop there. The analysts conduct a thorough investigation to understand how the incident occurred, gathering forensic evidence that helps in preventing future incidents.

    SOC Team Structure and Roles

    As a centralized function in an organization, SOCs have a team structure and different roles. The team must have cyber SOC expertise and collaborate to monitor, detect, analyze, and respond to cybersecurity threats.

    Key SOC Roles

    These are the critical roles that make up the SOC team:

    • SOC Manager: The SOC manager has a senior position overseeing an organization’s security operations. They’re responsible for evaluating, hiring, training, motivating, and guiding team members. They access incident reports, establish policies and procedures, manage resources and audits, and report to the Chief Information Security Officer (CISO).
    • Security Analysts:
      • Tier 1 analysts perform the initial monitoring and triage of alerts identifying potential threats.
      • Tier 2 analysts conduct deeper investigations into incoming threats, analyzing logs and network traffic to determine the severity and impact.
      • Tier 3 analysts are senior SOC cybersecurity experts who engage in threat hunting and severe incident analysis, providing insights for improving security measures.
    • Threat Hunters: Unlike typical SOC analysts who react to alerts, threat hunters actively search for threats that could easily go undetected. They utilize advanced techniques and tools to uncover hidden malware, vulnerabilities, and potential breaches before they can cause harm. They wade through system logs and network traffic, analyzing patterns of behavior to identify deviations, and then share the threat intelligence with stakeholders.
    • Incident Responders: Incident responders are cybersecurity experts who respond to incidents that require investigation and in-depth analysis. They use tools to determine an attack’s scope, cause, and impact. They’re also responsible for mitigating the damage and, when necessary, they may shut down specific systems or applications to contain the threat and protect sensitive data.

    The SOC team is a comprehensive group of experts who collaborate to manage a company’s cybersecurity operations. They monitor, detect, analyze, respond to, and investigate incidents in real time to protect an organization’s assets and information from cyber threats.

    Collaboration and Reporting

    The SOC must collaborate with other departments, including IT, legal, and compliance, to take a unified approach to cybersecurity. This collaboration ensures effective incident management and regulatory adherence.

    For example, working with the IT team helps implement security measures and integrate security tools such as security information and event management (SIEM) software. The IT department ensures the SIEM has the right resources to monitor and analyze security events. This includes maintaining servers, networks, and security tools essential for SOC operations.

    The legal team reports to risk management about threats, impacts, and what constitutes a data breach. Their role is to inform stakeholders about their legal obligations. The legal team also guides a company in adhering to data protection laws and regulations by providing legal insights on data handling practices and compliance requirements.

    The SOC also collaborates with compliance departments to ensure security practices meet industry regulations such as GDPR, HIPAA, etc. This partnership helps with the auditing processes and maintains documentation that demonstrates adherence to legal standards. At the end of the day, the SOC reports to the CISO to ensure that cybersecurity strategies align with organizational goals, providing critical insights into threat landscapes, incident management, and security posture.

    Benefits of a SOC

    A SOC can benefit an organization in many ways, but for most companies, the primary role is protection against costly data breaches. The financial impact of cybercrime is enormous, costing the global economy trillions of dollars in losses annually. Moreover, threats are growing faster than the global economy and can leave a company in limbo. SOCs provide a dedicated team tasked with protecting you in this shifting landscape.

    Asset Protection and Business Continuity

    When you close your business at the end of the day or during the weekend, cyber attackers don’t clock out. That’s why a SOC operates 24/7, even after business hours, to monitor your organization’s IT infrastructure and ensure no unauthorized access to the system or network. It allows for the early detection of suspicious activities and potential threats and establishes incident response plans for identifying, containing, and mitigating security incidents.

    The SOC collaborates with IT to enforce strict access controls and authentication measures so that only authorized personnel can access intellectual, sensitive data, and systems. Even insider threats stand no chance of accessing what they shouldn’t.

    In case of a threat, the SOC helps to contain it, eradicate malware or vulnerabilities from the environment, and restore affected systems to normal operations. This step ensures that the same attack cannot recur and lets business operations continue without disruptions.

    Regulatory Compliance

    Non-compliance with industry regulations can cost your organization in legal consequences and even its reputation. A SOC helps you stay compliant by documenting and regularly reporting on your security posture.

    Your SOC prevents data breaches by dealing with threats before they happen. When they do happen, SOC plans to mitigate damage and restore operations are put into effect. It also conducts thorough documentation that details the nature of incidents, response actions taken, and outcomes. This documentation helps with regulatory compliance and provides a record that can be referenced in future audits or investigations.

    A SOC’s data privacy plans, through the implementation of data protection measures, ensure sensitive information doesn’t fall into the wrong hands, which would cause compliance issues. By working with compliance teams that ensure security policies align with legal requirements, the SOC facilitates a comprehensive approach to maintaining regulatory compliance in an organization.

    Cost Savings and Customer Trust

    Data breaches are costly to recover from, not just in terms of money but also your organization’s reputation. Customer trust may decrease, which can impact your bottom line.

    Through an effective SOC, you demonstrate a strong cybersecurity posture. This enhances customer confidence in your organization’s ability to protect sensitive data, ultimately fostering loyalty and potentially increasing market share. With a well-functioning SOC, you don’t need to hire additional personnel or hardware.

    Types of SOCs

    Organizations can choose from various models of security operations centers based on their specific needs, resources, and goals. The model you choose may have long-term effects on your cybersecurity posture.

    In-House SOCs

    If you wish to run your security operations as an organization, you can set up an in-house SOC. It means having a team within your organization to handle all cybersecurity matters with your own technology and security personnel.

    This model gives you greater control and customization, allowing you to tailor security measures to your needs. However, it requires significant upfront investment in technology and personnel, who must be cybersecurity experts, as well as ongoing operational costs. 

    Virtual SOCs

    Virtual Security Operations Centers (vSOCs) operate in the cloud, offering a flexible and scalable solution. They are ideal for smaller organizations seeking cost-effective cybersecurity measures. They eliminate the high costs associated with building and maintaining a traditional on-premise SOC, including expenses related to hardware and staffing. For smaller organizations with limited budgets, vSOCs provide access to advanced security capabilities at a fraction of the cost.

    As a business continues growing or facing fluctuating security demands, vSOCs can easily scale resources without the logistical complexities of physical expansion. With AI and machine learning integration, vSOCs can automate security tasks and enhance real-time threat detection capabilities.

    Global SOCs

    If your organization has a large geographical footprint that requires continuous monitoring, a global SOC (gSOC) is ideal. A gSOC operates across multiple geographic locations, providing round-the-clock coverage by leveraging teams in different time zones. Additionally, it oversees multiple regional SOCs by coordinating their activities and standardizing security protocols. Global SOCs can efficiently manage incidents on a larger scale and offer diverse expertise from different markets.

    Co-Managed SOCs

    You can partner with a co-managed SOC to get in-depth analysis and expertise. A co-managed SOC is a third-party security platform that combines in-house and managed SOCs. You can maintain your internal security team that collaborates with an external provider to enhance capabilities. This hybrid approach allows for greater flexibility, enabling you to gain external expertise for specific tasks such as 24/7 monitoring or incident response while retaining control over critical functions.

    Let your in-house IT team join TekStream SOC for advanced technologies, including Splunk for Security Information and Event Management (SIEM) and CrowdStrike for endpoint protection, to deliver managed detection and response services.

    Best Practices for Setting Up a Security Operations Center

    Your SOC team is only as good as the security strategies it implements. The following steps can help you get the most out of your team.

    Aligning SOC Operations with Business Goals

    For a SOC to be successful, objectives must align with your organization’s goals.

    When SOC initiatives are directly linked to business priorities, such as protecting customer data, ensuring compliance, and supporting operational continuity, the SOC demonstrates its value in mitigating risks that could impact the organization’s reputation and bottom line.

    Strong executive support that prioritizes cybersecurity fosters a culture of security awareness and encourages collaboration across departments.

    Moreover, long-term planning establishes a sustainable SOC. Organizations must anticipate future threats and evolving technologies, which requires adequate budgeting and resource allocation. Sufficient funding makes the SOC successful, enabling the unit to invest in the latest tools, skilled personnel, and ongoing training programs.

    Investing in People and Automation

    Skilled personnel in a SOC are some of your greatest defenses against threats. Integrating automation enhances efficiency by streamlining repetitive tasks such as alert triaging, data collection, and incident response. By investing in advanced automation tools, organizations can reduce the workload on SOC staff and let them focus on higher-level security tasks that require human expertise and strategic thinking.

    Keep your  SOC personnel sharp with continuous training on up-to-date cybersecurity trends and technologies. This investment empowers analysts to leverage automated systems effectively and improves job satisfaction by alleviating the burden of mundane tasks.

    Enhance Your Security Operations with TekStream

    As cyberattacks escalate and devastate organizations, a well-functioning security operations center is not just a strategic advantage. It cushions you from advanced cyber threats by continuously monitoring your network and systems. The team comprises IT and legal experts who provide your organization with updated technology and guidance to strengthen its cybersecurity posture.

    Staying compliant with industry requirements doesn’t have to be challenging, as SOC helps by maintaining rigorous monitoring and reporting practices. Investing in your SOC keeps your data and intellectual assets safe from hackers. No data breach means compliance; hence, there are no legal battles. Your business continuity is uninterrupted, and customers and stakeholders stay happy.

    Keep your security more resilient with the help of TekStream’s security experts. Outsourcing security operations to an MDR provider gives you access to advanced threat detection capabilities without the high costs of an in-house security team.

    Learn more about our integrated MDR solution and the technologies we use to keep you ahead of threats or contact us to speak with our team!

  • Troubleshooting Guide: Assets & Identities in Splunk Enterprise Security

    Troubleshooting Guide: Assets & Identities in Splunk Enterprise Security

    By Kamal Dorairaj, Senior Splunk Consultant

    Splunk Enterprise Security (ES) uses an asset and identity (A&I) information management system to correlate asset and identity information with events to provide context and enrich data. There are many docs and discussions on how to populate these A&I in Splunk ES but not many on how to troubleshoot A&I issues and validate the framework. This blog covers various actions as well as steps to assess and validate the A&I framework in Splunk ES.

    1. Validate Search Preview

    In Splunk ES, Navigate to Configure -> Data Enrichment -> Assets and Identity Management-> Search Preview. 
    All three search in this page run periodically to make sure that the ES framework is using the latest and updated assets and identities. For example: When we expand the “Identity_lookup_expanded” SPL, there will be two macros which are merged into identity and updated into the identity lookup file. Ideally when we open the search preview SPL, it should return zero events. Returning zero events means the KV store committed all the changes to the collections. It commits changes every 300 seconds which is configured under “Time” in the Miscellaneous Settings -> Global Settings.  

    2. Validate the Macros

    Run the “identity_lookup_expanded” SPL in a separate search. Below is an example of the SPL. 

    Splunk SPL search string showing identity correlation logic using eval and inputlookup.

    In this `add_entity_source(“TS Identities”,”TS Identities”)` is the macro that pulling the Identity details. Open this macro in a separate search window and expand it. Here we can see all the lookup files the search references.  

    Splunk Enterprise Security interface showing inputlookup and fillnull for TS Identities.

    Navigate to Settings -> “Searches, Reports and Alerts” -> Search for the “TS Identities”. Click the Report -> Review the SPL -> The search in this report is populating the above file. The SPL can be run over 7 days or 30days to check when it’s being populated. 

    3. Validate Correlation Setup

    Go to “Correlation Setup” under Asset and Identity Management -> Select “Enable for all sourcetypes” as in screenshot below. 

    Correlation setup options in Splunk Enterprise Security for asset and identity mapping.

    By enabling this option, every single search run on ES goes thru the identity lookup expanded and asset lookup expanded.  
    Let’s say for example, you have user=bob then correlation will try check to if identity=bob then try to pull all the information from the identity and details found and use it to enrich the events. So, this setting is very important for the ES framework. 

    4. Validate Enforce Props

    The “Enforce props” setting should be enabled under the Global Settings. If we do not enable this option, then the framework will be using stale lookups and not receiving the enrichments on ES searches. This setting is a must for RBA.  

    Enabling this option would bring more risk fields into the automatic lookups. If not enabled, then we are not running the latest version of the automatic lookups. Also, if there are any custom fields in the identity fields, those won’t be available in the automatic lookup. Basically, custom fields won’t be enriched in all the searches. Go to “Searches, Reports, and Alerts” -> Search for “SA-IdentityManagement” -> All the lookups for src, dest, user, src_user. On the backend, Splunk uses props to provide the enrichments for all these fields. 

    Splunk enforcement settings for props, macros, transforms and identity lookup.

    5. Validate Lookup Files

    Permissions of all the lookup files needs to be reviewed. Go to Lookups -> Lookup definition -> search for the lookup -> make sure permissions looks accurate. If correct, then take note of the csv file name and navigate to Lookups -> Lookup files -> check permissions and confirm it also looks correct.  

    The permissions should be scoped as global.  
    If all permissions appear accurate in the UI then directly ssh into the server.  

    Navigate to cd /opt/splunk and search for the lookup file by executing the following command: 

    Bash terminal command to locate assets_network.csv file for troubleshooting.

    Next run this: 

    ls -al <path of the file name returns from the above> and less the file name. 

    Terminal command to search for assets_network configuration in inputs.conf.

    Basically, looking for the csv files defined in any inputs.conf stanzas. 

    Next, check If any transforms are using it with the following: 

    Command-line search for assets_network references in transforms.conf file.

    6. Validate Thru Logs

    To look for any errors or issues in the log file, run the below SPL: 

    index=_internal source=*entity*  

    Check the source field for a list of used sources. We can see ‘identity manager log’, ‘entity merge log’ and ‘identity correlation rest handler log’. All these logs are related to the assets& identity framework logs. 

    For Example: A customer experienced WLM blocking their searches. Using the above SPL, we were able to further troubleshoot our issue. 

    When the identity manager runs it sends logs for everything into identity manager log. 

    Index=_internal source=*identity_manager.log 

    In the source field narrow your SPL to investigate the splunkd_access log. All rest calls executed are written in this log file. Make sure all the values for the filed status are “200”. 

    Splunk ES runs *Audit -* scheduled searches every day, which are it’s all-health check searches.

    Now, you can populate A&I in Splunk ES, but you also have a guide for troubleshooting issues and validating the framework. Splunk Enterprise Security is considered the most robust security platform out there, and with this set of steps you can ensure you’re getting the most from your instance.

    Our team is available if you have additional questions, just inquire using the form below. Find more Splunk Technical Blogs here, and learn more about TekStream Splunk Services here. Happy Splunking!

  • Recovering Deleted or Overwritten Dashboards in Splunk 

    Recovering Deleted or Overwritten Dashboards in Splunk 

    By Aaron Dobrzeniecki, Senior Splunk Consultant

    Have you ever been in a situation where you are heads down, grinding on your work, when you accidentally delete or overwrite a very crucial dashboard? If so, no need to panic! We have a resolution to recover your important dashboard.

    Accidentally deleting dashboards in Splunk can be a nerve-wracking experience, especially for those who rely on these powerful tools for monitoring and analyzing critical data. In this blog post, we’ll explore one very powerful way for you to recover your Splunk dashboard (the XML code) inside of Splunk’s internal logs.

    This use case came about when I was working with a customer on his high-level management dashboards. My customer had been working on these dashboards for higher ups for about 2 weeks, inputting critical information and designing his dashboards to show only the points of interest. Once he realized he had overwritten his dashboard, panic set it. He immediately reached out to me for a solution to recover his dashboard. As I had seen this issue before, I immediately dipped into my bag of searches and tricks, digging for a solution to his problem. 

    Find Old XML Coding

    The search below will provide insight and OLD xml coding to your previously saved dashboard. 

    index=_internal dashboard_shortname sourcetype=splunkd_conf data.payload_extra=* 

    Let me breakdown the search to give a little bit more insight. 

    Obviously we are searching the internal index of Splunk, so make sure someone has access to this index as this is where the code is stored for dashboards. The dashboard_shortname is the name of your dashboard when you see it in the Splunk URL. Please see the example below: 

    Example URL: https://organization.splunkcloud.com/en-US/app/search/data_quality?form.time_picker.earliest=-24h%40h

    data_quality is the dashboard shortname for this example

    Including the sourcetype of splunkd_conf will assist with making the search results return quicker. Finally, data.payload_extra, this field is crucial when recovering previously overwritten dashboard code. This is the field where the XML code is kept in the internal event.

    I took one of my dashboards and purposely overwrote it for this post. Please see the overwritten code of my dashboard in the screenshot below: 

    A screenshot of a Splunk configuration or API output view, displaying complex search queries, data parsing settings, and repository synchronization details with a "status: applied" message.

    I was able to use the search I created above to find the newly overwritten xml code. I will use the same exact search to find the original xml code for my dashboard. Any time before 10:55AM ET on June 17 and after 10:53AM ET, I will be able to find my original code.

    NOTE: For your xml code to show up in the internal logs, you need to save your dashboard. I saved my original code at exactly 10:54 AM ET, and then overwrote it. Please see the original code for my dashboard below: 

    A screenshot of Splunk configuration code displaying complex search definitions, payload_extra settings, and data source configurations.

    Not only does this save you time, effort, and stress, but it is a great way to recover any mistakes made onto your dashboard.

    In conclusion, recovering dashboards is essential for keeping data monitoring and analysis smooth and reliable. By having good backup and recovery plans, companies can reduce downtime and prevent data loss, making sure their important information stays accurate. Regularly updating and testing these plans, and using the right recovery tools, will help handle unexpected problems better. In the end, being prepared for dashboard recovery helps create a stable and secure data system, allowing businesses to make smart decisions and stay productive.

    Read more about TekStream Splunk Services here.

  • Enterprise Security Threat Intelligence

    Enterprise Security Threat Intelligence

    By Kyle Moreau, Security Engineer

    While there is a lot of information available for Enterprise Security’s threat intelligence platform, setting it up and understanding how it works with your data can get confusing. This article provides a simple approach to configuring and understanding how all the pieces come together.

    Threat Intelligence is an invaluable tool that can assist your security team in detecting malicious activity in your environment. To enrich your data and utilize the vast amount of threat intelligence available, Splunk Enterprise Security comes with out-of-the-box threat intelligence sources, searches, and correlations. Configuring and customizing this tool is an foundational step you can take toward your threat intelligence journey.

    Start by navigating to the Enterprise Security App and open the configuration tab.

    Enterprise Security -> Configure -> Data Enrichment -> Threat Intelligence Management

    A screenshot of the Enterprise Security interface showing the "Configure" dropdown menu open, with the "Threat Intelligence Management" option highlighted.

    Under Sources you will see a list of pre-configured threat intelligence feeds. These sources are configured with a description, polling interval, type, source URL, and weight. By default, these sources are disabled.

    A screenshot of the "Threat Intelligence Management" interface in Enterprise Security, showing the "Sources" tab with a table of configured threat intelligence feeds and their URLs.

    Once here, enable the intel sources you would like to use. Additionally, you can add your own intel sources. If you’d like to add your own intel, start by reviewing the supported collection types and required fields.

    To configure an existing source, navigate to the upper right side of the Sources tab, select New. Then select the type of data source you will be gathering intel from.

    A screenshot of the "New" dropdown menu in the Splunk Enterprise Security interface, showing threat intelligence input options including "Line Oriented," "IOC/STIX/STIX 2," and "TAXII."

    To add a Local source, configure a Managed Lookup: Configure -> Content Management -> New Managed Lookup.

    A screenshot of the "Create New Content" dropdown menu in Splunk Enterprise Security, showing options to create an "Analytic Story," "Correlation Search," "Data Model," and other security analysis components.

    Threat Intel can come in so many different formats or processes. Custom Threat Intel sources, especially those tailored to your environment, would be a powerful tool to strengthen your security posture. If you have any questions about how to add a custom feed or include IOCs you’ve collected, fill out the form below and see how we can assist you.

    To view a breakdown of the Threat Intel Artifacts, go to Enterprise Security -> Security Intelligence -> Threat Intelligence -> Threat Artifacts.

    The Threat Matching tab contains the searches that generate threat activity data.

    These searches pull IOC data together then search across a specific data model by select fields. For example, IP IOCs added from a source feed get compiled into a KV store lookup. The Threat Matching search for src searches those IP Addresses against logs from the Network, Web, and IDS data models. If there is a match, the activity will get listed under Threat Activity.

    Threat Activity can be viewed by either searching index=threat_activity or the dashboard located at: Enterprise Security -> Security Intelligence -> Threat Intelligence -> Threat Activity.

    Below is an example of a threat source IP Address matching a login attempt from an external actor.

    A screenshot of the Splunk interface displaying a detailed analysis of the "ErrorMessage_2" field, including the distribution and top 10 values.

    The threat activity log shows the source, time, and specifics about what IOC matched the data. In this case the IP Address is from the iblocklist_spyware source that comes with ES. Here we can perform additional searches to see why this address is on the list. The log source information can be used to pivot to the originating logs to gather context around the activity.

    Getting hits like these fuels an investigation and can reveal malicious activity. From the hit above the following questions could be derived; Is this IP a residential ISP or a Cloud IP? Is this a typical location for this user? Is this an expected time of day to be logging in? Was the login successful? Were any other accounts targeted?

    Reach out to a TekStream expert using the form below to discuss utilizing threat intelligence in your environment, customizing your intel feeds, validating sources, and getting the most out of what Splunk has to offer for threat intelligence. You can also read more Splunk Technical Blogs here, and learn about TekStream Splunk services here. Happy Splunking!

  • Routing PII Data to Multiple Indexes

    Routing PII Data to Multiple Indexes

    By Eric Levy, Splunk Consultant & Zubair Rauf, Team Lead, Cybersecurity Engineering

    As Splunk Consultants we often come across customers who log personally identifiable information (PII) data on their systems that need to be indexed into Splunk for various use-cases. This data can be part of but not limited to sales logs, health records, and many other types of log files. This data can be used by various teams which may or may not require access to the PII to build analytics on this data for their daily business needs.

    Oftentimes, multiple teams interact with the same data, but some teams would need to have sensitive portions masked/removed. In this blog post we will talk about a use-case which deals with logs from a sales system that records customer’s credit card information when a sale is processed and generates error logs if something doesn’t go as planned.

    We used a custom-built script to generate some sample logs which are shown below. The script uses random words from the dictionary to record error messages:

    2024-01-11 11:22:38: [TransactionID=1259] [CreditCardNumber=1516-3643-1843-5285] [TransactionAmount=265.81] [TransactionStatus=0]
    2024-01-11 11:22:41: [TransactionID=1606] [CreditCardNumber=3301-5491-1216-2042] [TransactionAmount=49.29] [TransactionStatus=0]
    2024-01-11 11:22:44: [TransactionID=1814] [CreditCardNumber=8894-10012-6514-9377] [TransactionAmount=878.50] [TransactionStatus=1]
    2024-01-11 11:22:48: [ErrorMessage=piscian iodine tussive intenability alody trypanosomatous hypabyssal supervast splashing japishness ] [ErrorStackTrace=piscian iodine tussive intenability alody trypanosomatous ]
    2024-01-11 11:22:51: [TransactionID=1735] [CreditCardNumber=2525-2750-4478-8785] [TransactionAmount=275.86] [TransactionStatus=1]
    2024-01-11 11:22:55: [ErrorMessage=monadelphous triakistetrahedral slippery belage pungapung pustule leucophanite mantispid spiritualty misdetermine ] [ErrorStackTrace=monadelphous triakistetrahedral slippery belage pungapung pustule leucophanite mantispid spiritualty ]
    2024-01-11 11:22:58: [TransactionID=1470] [CreditCardNumber=9384-8198-3585-2396] [TransactionAmount=370.37] [TransactionStatus=0]
    2024-01-11 11:23:02: [ErrorMessage=Sunil Gaditan piaster pudicity tarkeean Juan ] [ErrorStackTrace=Sunil Gaditan piaster pudicity tarkeean Juan Sulafat trowelful ]

    We will explore two methods to route and filter the same data and index it in two different indexes. We will use the Splunk props.conf and transforms.conf configuration files to transform our data and achieve the desired results.

    Splunk‘s props.conf file allows Splunk admins to configure how the incoming data will be parsed — how to break events in a log stream, parse timestamps, call transforms to data, and create fields. The rules defined in transforms.conf are applied in the props configuration.

    Splunk’s transforms.conf file allows Splunk admins to configure rules for transforming data. It allows users to mask data, create fields at index time, rewrite fields, and configure lookups.

    The props.conf and transforms.conf configurations reside on search heads, indexers, and heavy forwarders, as well as universal forwarders in some cases. More details about Splunk’s props can be found in my colleague’s blog post – Data Onboarding in Splunk

    Method 1 – Mask PII and send all data to a separate index

    The first method demonstrates how to send all sales log data (transactions and error logs) to a separate index where teams who need access to masked data for their job can use the data.

    The unmasked sales data is ingested as the sourcetype named private_sourcetype (for ease of understanding) into the private_index. The configs can be deployed to a new TA that can be used for parsing or $SPLUNK_HOME/etc/system/local/props.com|transforms.conf files.

    With this method, we will first clone the private_sourcetype into a new sourcetype called public_sourcetype, where PII will be masked, and then route it to a public_index.

    Parsing for both private_sourcetype and public_sourcetype should be done by using the props.conf settings shown further down this post.

    To start, in our transforms.conf, we define the transform stanza that will clone our sourcetype. The cloned sourcetype will perform all remaining transformations.

    ###transforms.conf
    [clone_sourcetype]
    CLONE_SOURCETYPE = public_sourcetype
    REGEX = .
    DEST_KEY = _METADATA:Index
    FORMAT = public_index
    WRITE_META = true
    

    This stanza calls the CLONE_SOURCETYPE command, which is the “secret sauce” of this trick. CLONE_SOURCETYPE allows you to duplicate data into another sourcetype. We then set the DEST_KEY to modify the index, indicating through REGEX value of .indicating that we want to replace the entire value and setting FORMAT to the name of the new index – in this case, “public_index” (since it will house our masked data).

    Below props.conf shows how the transform is applied to the sourcetype. These props for the private_sourcetype is using the Super Six recommended settings to parse the logs while ingesting into Splunk.

    ###props.conf
    [private_sourcetype]
    LINE_BREAKER = ([rn]+)
    SHOULD_LINEMERGE = false
    TIME_PREFIX = ^
    TIME_FORMAT = %Y-%m-%d %H:%M:%S
    MAX_TIMESTAMP_LOOKAHEAD = 20
    TRUNCATE = 200
    TRANSFORMS-public_sourcetype = public_sourcetype
    

    The second set of transforms that will be included in the same transforms.conf file will mask the data the before it is indexed into the new public_index so that it can be consumed by the right people without exposing PII data.

    ###transforms.conf
    [mask_credit_card_info]
    REGEX = ^(.*?)CreditCardNumber=d{4,5}-d{4,5}-d{4,5}-d{4,5}(.*)$
    FORMAT = $1CreditCardNumber=XXXX-XXXX-XXXX-XXXX$2
    DEST_KEY = _raw
    

    The syntax is very similar to how we replaced the index name for the cloned data – we specify our REGEX for the events we want to target (which, in this case, is anything with a credit card number), then apply the FORMAT to the specific portion of the event we want to replace (hence the event being surrounded by $1 and $2), and finally set our DEST_KEY to mask our data within the _raw event.

    To apply these transforms we use the props.conf settings shown below to the public_sourcetype stanza:

    ###props.conf
    [public_sourcetype]
    LINE_BREAKER = ([rn]+)
    SHOULD_LINEMERGE = false
    TIME_PREFIX = ^
    TIME_FORMAT = %Y-%m-%d %H:%M:%S
    MAX_TIMESTAMP_LOOKAHEAD = 20
    TRUNCATE = 200
    TRANSFORMS-mask_credit_card_info = mask_credit_card_info
    

    When all these props and transforms are applied the private_index should show the unmasked data and the public_index should show the masked data:

    A screenshot of Splunk log events showing raw PII data, including credit card numbers and transaction amounts, along with index and sourcetype metadata.
    A screenshot of Splunk log events displaying masked PII data, where credit card numbers are replaced with X's, and the data is routed to a public_index.

    Method 2 – Filter and route error logs to a separate index

    With this method, we will explore how to filter and route error logs to the public_index. With this method we do not need to mask the PII as it is not being routed to the public_index.

    To start, like we did in method 1, we will clone the sourcetype to sales_error_log (to make it easy to identify the data) using the transforms.conf config file.

    ###transforms.conf
    [clone_sourcetype]
    CLONE_SOURCETYPE = sales_error_log
    REGEX = ^.*ErrorMessage=
    DEST_KEY = _MetaData:Index
    FORMAT = public_index
    WRITE_META = true
    

    In the above clone_sourcetype transforms stanza, we use the CLONE_SOURCETYPE parameter to specify a name for the new source. As we are only cloning the error message events, we specify a REGEX that matches the relevant event format. We also add DEST_KEY to identify that the destination for these new duplicated events is the public_index.

    We apply these transforms in the props.conf to the private_sourcetype and also create a new stanza for the sales_error_log so that Splunk can easily parse the duplicated logs as well without issue.

    [private_sourcetype]
    LINE_BREAKER = ([rn]+)
    SHOULD_LINEMERGE = false
    TIME_PREFIX = ^
    TIME_FORMAT = %Y-%m-%d %H:%M:%S
    MAX_TIMESTAMP_LOOKAHEAD = 20
    TRUNCATE = 200
    TRANSFORMS-clone_private_sourcetype = clone_sourcetype
    
    [sales_error_log]
    LINE_BREAKER = ([rn]+)
    SHOULD_LINEMERGE = false
    TIME_PREFIX = ^
    TIME_FORMAT = %Y-%m-%d %H:%M:%S
    MAX_TIMESTAMP_LOOKAHEAD = 20
    TRUNCATE = 200
    

    With these props and transforms settings, we should be able to duplicate the error logs and send the duplicated copy to the public_index for consumption.

    A screenshot of Splunk log events showing unmasked PII data, including credit card numbers and transaction information, along with error messages and source configuration details.
    A screenshot of Splunk error logs displaying events with ErrorMessage and ErrorStackTrace fields, showing data from a sales_error_log sourcetype.

    Here we’ve outlined two ways you can route sensitive PII data to multiple indexes using props and transforms without duplicating at the source. The first puts the same data in both indexes while redacting sensitive information (in this case, a credit card number) while the second separates regular events from error messages. Both approaches show Splunk’s flexibility in data management configurations and how it can provide tailored solutions for a wide array of use cases.

    Find other Splunk blogs here, Splunk offerings here, and always feel free to reach out if you have any questions. Happy Splunking!

  • You’ve Changed, Man! Using Stream Stats and For Each To Track Changing Splunk Fields

    You’ve Changed, Man! Using Stream Stats and For Each To Track Changing Splunk Fields

    By Eric Levy, Senior Splunk Consultant and Marvin Martinez, Team Lead

    If there’s one thing you should know about Splunk, their SPL (Search Processing Language) often makes the impossible possible. In a recent use case, my colleague Marvin Martinez and I needed to audit changes to an artifact event and know exactly which fields changed at what time. Sadly, Splunk events aren’t indexed in array form and, thus, there’s no explicit visibility to directly compare consecutive events. However, if you put the data in a table in the sequence you want and use the magic of | streamstats and a few | foreach commands, you can output exactly which fields changed between events, and when they changed!

    TUTORIAL

    For this example, we use three generated fields to exemplify three use cases.

    Our first field, “field1”, will exemplify a field that changes between three events. The value of field1 will be different for each event. Thus, we should expect to see it for all of our results.

    Our second field, “field2”, will exemplify a field that becomes null and is later set to another value. Thus, we should expect to see it be set to a value in the first event, null in the second event, and not null in the third event.

    Our third field, “field3”, will exemplify a field that does not change across the entire span of events. Thus, we will see it in the first event, but not the other two events.

    Using some generative SPL, this is what our data looks like:

    At this point, the instructions are pertinent for transforming raw events using this command.

    Start by tabling out the fields you care about and use a fillnull value of “THIS_IS_NULL” to give null values something to pass into later comparisons (otherwise, you will receive an error).

    | table [YOUR FIELDS HERE]

    | fillnull value=THIS_IS_NULL

    THE FOREACH COMMAND

    Similar to a for-loop in coding, the | foreach command iterates through all values of a specified Splunk field. You start by invoking the command, listing the field, and referring to the field using the <<FIELD>> syntax within actions enclosed in brackets.

    As a simple example, if I had a field named “index” that appeared in ten events, I can tell Splunk to increment each value of “index” by 1 over all events as follows:

    | foreach index [<<FIELD>> = <<FIELD>> + 1]

    Now, back to the tutorial!

    We use the foreach command to first ensure we correlate the field name to the field value.

    | foreach * [ eval <<FIELD>> = “<<FIELD>> = ” . <<FIELD>> ]

    Putting <<FIELD>> in quotes allows us to return the field name, whereas <<FIELD>> outside of quotes on the other side of the equals sign returns the actual value for each field.

    Now that we have a chronological history of the field values, we can leverage streamstats to gather the previous value of each field in order to compare and determine if the field had changed at all.  Streamstats is very powerful as it allows you to execute stats-like calculations and grouping without transforming your data set.

    To achieve this, we use the SPL line below, using the last() function, in conjunction with the “current=f” (to not count the current value in the stats calculation), to grab the previously seen field value. We prefix the output fields with “last_” so we can easily reference them in our downstream SPL lines and not overwrite the original field or have them named something that won’t be easily referenced.

    | streamstats current=f window=1 last(*) as last_*

    Run another foreach command that uses the mvappend function to put the previous and current field values in a single field, then get rid of the “last_*” fields from the table.

    | foreach * [eval <<FIELD>> = mvappend(<<FIELD>>, last_<<FIELD>>)]

    | fields – last_*

    The next line of SPL is the core of this tutorial. By this point, our fields host a multivalue field that recognizes the original field for that event at index 0, and the previous field at index 1. As such, we use a foreach that nulls out fields where the two values are the exact same, and if not, replaces the value with the original field. We can access individual values in a multivalue field using the mvindex() function.

    | foreach * [eval <<FIELD>> = if(mvindex(<<FIELD>>, 0) = mvindex(<<FIELD>>, 1), null(), mvindex(<<FIELD>>, 0))]

    Now, let’s make our null values look a bit nicer by formatting our null values appropriately:

    | foreach * [eval <<FIELD>> = if(match(<<FIELD>>, “THIS_IS_NULL”) OR match(<<FIELD>>, “=snull”), “<<FIELD>> = null”, <<FIELD>>)]

    Finally, while optional depending on how you want to format the events, iterate through the events one more time to add them to a new multivalue field, remove any duplicate field attributes within your events (not applicable to this example, but can happen) and re-format your fields appropriately to look like this:

    | eval fields = mvdedup(fields)

    | fields fields

    We can conclude that field1 and field2 changed values through all three events, while field3 remained the same. Additionally, our search caught that field2 became null and then set to another value.

    Thanks to this SPL, we can determine which fields have changed over an event. Here is the complete query, including the generative set-up commands:

    | makeresults

    | eval field1=”this will change”

    | eval field3=”this will not change”

    | append [| makeresults | eval field1 = “this has changed” | eval field2=”this is not null” | eval field3=”this will not change”]

    | append [| makeresults | eval field1 = “this has changed again” | eval field2=”this is not null anymore” | eval field3=”this will not change”]

    | fillnull value=THIS_IS_NULL

    | table *

    | foreach * [ eval <<FIELD>> = “<<FIELD>> = ” . <<FIELD>> ]

    | streamstats current=f window=1 last(*) as last_*

    | foreach * [eval <<FIELD>> = mvappend(<<FIELD>>, last_<<FIELD>>)]

    | fields – last_*

    | foreach * [eval <<FIELD>> = if(mvindex(<<FIELD>>, 0) = mvindex(<<FIELD>>, 1), null(), mvindex(<<FIELD>>, 0))]

    | foreach * [eval <<FIELD>> = if(match(<<FIELD>>, “THIS_IS_NULL”) OR match(<<FIELD>>, “=snull”), “<<FIELD>> = null”, <<FIELD>>)]

    | foreach * [eval fields = mvappend(fields,<<FIELD>>)]

    | eval fields = mvdedup(fields)

    | fields fields

    Happy Splunking!

    About the Authors

    Eric Levy is a Splunk Core Certified Consultant who joined the TekStream team in July 2022. Eric’s background and eagerness to learn makes him excited to unlock the data possibilities Splunk has to offer its clients. Eric’s portfolio of projects makes him well adapted to time management and a diverse array of technical situations and has since expanded his horizons into Enterprise Security engagements as well as a full-time member of the IRS Splunk team. Eric resides in Arlington, Virginia and is a proud Virginia Tech graduate. In his free time, he continues to pursue his love of music.

    Marvin Martinez has nearly 20 years of combined experience in software and workflow development and nearly 5 years as a Splunk Core Certified Consultant and certified SOAR developer, most recently operating as a team lead on the MDR (Managed Detection and Recovery) team and leading a team of SOAR developers to architect, administer, design, develop and enhance automation playbooks and activities as part of the incident resolution process with Splunk SOAR. For the first 15 years of his career, he was primarily focused on Inspyrus Invoice Automation installation, design and configuration, including PL/SQL, Workflow Forms Recognition (WFR), Oracle Enterprise Capture, EBS/JDE/Fusion integration, and BPEL/BPM development, as well as working within and managing Oracle Cloud Infrastructure (OCI) and ancillary BPEL/BPM development and becoming a certified OCI Architect Associate and AWS Developer Associate. Marvin has a proven track record of being motivated, technologically agile, quick and eager to learn, efficiently productive, and an effective communicator, able to work proficiently as part of a team as well as independently/remotely.

  • What is MDR?

    What is MDR?

    Exploring Managed Detection and Response for Enhanced Cybersecurity

    Cybersecurity is not a set-and-forget task — your business needs to keep pace with the ever-changing tactics of cybercriminals. However, your organization has core priorities besides security, such as growth and customer satisfaction. How can you make sure security is managed well without breaking the budget? The answer may lie in leveraging a managed detection and response (MDR) service like the kind we offer at TekStream Solutions.

    MDR is designed to provide real-time threat detection and rapid response, ensuring your business remains secure. But what is MDR, and why should you use it? Join us as we explore how MDR helps your business stay ahead of cybercriminals.

    What is Managed Detection and Response? 

    MDR, meaning Managed Detection and Response, involves continuous, proactive monitoring of an organization’s IT infrastructure for malicious activities or policy violations. It’s a comprehensive solution that leverages advanced technology, expert analysis, and proactive threat hunting to scan endpoints, networks, applications, and other digital assets.

    MDR detects anomalies that could indicate a security incident and analyzes and responds to cybersecurity threats in real-time. It goes beyond traditional security measures by providing continuous monitoring, threat intelligence, and rapid incident response capabilities.

    MDR consists of several key components:

    1. Continuous monitoring: MDR services employ advanced tools to monitor your network, endpoints, and cloud environments 24/7, looking for any signs of suspicious activity or potential threats.
    2. Threat detection and analysis: MDR systems use a combination of machine learning, behavioral analytics, and human expertise to identify known and unknown threats, including zero-day exploits and advanced persistent threats (APTs).
    3. Rapid response: Once a threat is confirmed, MDR teams swiftly contain and neutralize it, minimizing potential damage to your systems and data.
    4. Remediation: After addressing an immediate threat, MDR services help organizations implement measures to prevent similar incidents in the future and strengthen overall security posture.

    At TekStream Solutions, we offer cutting-edge MDR solutions that leverage the power of Splunk. Our solutions provide unparalleled visibility and protection across your entire digital ecosystem.

    What is MDR in cybersecurity for and why is it becoming an indispensable tool for businesses of all sizes? To understand its significance, we need to examine its place in the cybersecurity ecosystem.

    What is MDR’s Role in the Cybersecurity Ecosystem?

    While MDR cybersecurity services focus on monitoring, detection, and response capabilities, other components complement and enhance your cybersecurity posture. Let’s see how MDR compares to other common cybersecurity solutions:

    1. EDR (Endpoint Detection and Response): While EDR focuses solely on endpoints like computers and mobile devices, MDR takes a holistic approach by covering your entire IT infrastructure.
    2. SIEM (Security Information and Event Management): SIEM tools collect and analyze log data from various sources. MDR goes a step further by analyzing this data and providing active threat-hunting and response capabilities.
    3. MSSP (Managed Security Services Providers): MSSPs typically offer a broad range of security services. MDR, however, specializes in advanced threat detection and response, providing deeper expertise and more focused protection.

    MDR doesn’t replace these solutions—it works alongside them by filling gaps and providing an extra layer of security. Now that we’ve contextualized MDR within the broader security landscape, it’s time to unpack the unique advantages it offers in protecting digital assets.

    What Are the Benefits of MDR?

    Now that we understand how MDR fits into your cybersecurity ecosystem, let’s explore the tangible benefits it brings to your organization.

    Enhanced Threat Posture

    MDR utilizes advanced technologies and expert analysis to identify known and unknown threats. This helps to significantly improve an organization’s ability to detect sophisticated attacks that might slip past traditional security measures.

    Rapid Incident Response

    With 24/7 monitoring and a team of security experts at the ready, MDR enables swift responses to potential threats. Acting fast can dramatically reduce the impact of a security incident and potentially save organizations millions in breach-related costs.

    Access to Cybersecurity Expertise

    Managed detection and response provides organizations with access to skilled security professionals without needing an expensive in-house team that would likely get alert fatigue over time.

    Cost-Efficiency

    By outsourcing advanced security functions to an MDR provider, organizations can achieve a higher level of security at a lower cost than building equivalent capabilities in-house. MDR services often operate on a predictable subscription model, making cybersecurity budgeting more straightforward. Subscription models also make it easier to scale up and down when necessary.

    Compliance Support

    Many MDR services include features that help ensure compliance with various regulatory standards, such as HIPAA and GDPR. This ensures that organizations can more easily meet legal and industry obligations.

    While these benefits are significant, it’s important to regularly evaluate your MDR solution to ensure it continues to meet your organization’s changing security needs.

    MDR in Action: How it Enhances Your Cybersecurity Defense Strategy

    What is MDR capable of? Let’s unpack its operational benefits and see how it strengthens your defenses.

    Continuous Improvement

    As cyber threats evolve, so too must the defenses against them. MDR solutions are designed with this principle in mind for:

    • Threat intelligence updates: MDR providers constantly update their threat intelligence databases. Incorporating information about new threats into these updates makes it easier to recognize vulnerabilities and prepare for attacks.
    • Machine learning enhancements: Many MDR solutions use machine learning algorithms that get better at identifying anomalies and potential threats over time.
    • Procedural refinements: MDR providers regularly refine their response procedures based on real-world incidents and emerging trends to ensure they remain effective against new attacks.

    Real-Time Threat Monitoring

    MDR security systems maintain 24/7 surveillance. By constantly analyzing network traffic, user behavior, and system logs for any signs of suspicious activity, MDR protects your data at all times. This process goes beyond simple pattern matching; instead, it employs advanced behavioral analytics to identify anomalies that might indicate a threat.

    Advanced Analytics

    MDR leverages advanced analytics to turn raw data into actionable intelligence. These systems can handle massive volumes of data and process it at lightning speed. Even if it’s an attack the system hasn’t seen before, it analyzes patterns that might indicate a threat.

    Automated Responses

    Every second counts when it comes to cybersecurity. That’s why MDR incorporates automated responses to neutralize threats quickly. These systems come equipped with predefined response actions for common types of threats. The system can escalate complex threats to human analysts while taking initial containment measures to limit damage.

    Managed Detection

    The “managed” in MDR means you’re getting a tool and a service backed by expert human analysts. Here’s what that entails:

    • Expert monitoring: Skilled security professionals oversee the MDR system for an extra layer of vigilance.
    • Context and interpretation: Analysts interpret alerts in the context of your specific environment to reduce false positives.
    • Threat hunting: MDR teams proactively search for hidden threats that automated systems might miss.

    The human element in MDR ensures that you receive more than automated alerts—you receive informed, contextualized insights into your security posture.

    Response Capabilities

    When a threat is confirmed, MDR teams coordinate a response effort to ensure all necessary steps are taken to contain and neutralize a threat. For threats that require action from your internal team, MDR providers offer step-by-step guidance to ensure effective remediation.

    Integration with Existing Security Infrastructure

    MDR works alongside your existing security measures, enhancing rather than replacing your current tools and processes. MDR solutions can use data from your security tools, firewalls, and network devices to analyze weaknesses and fill gaps in your current security posture. Many MDR solutions provide a centralized dashboard with a holistic view of your security landscape.

    The next question is, how do you select an MDR provider who will ensure your business stays threat-resilient? Here are a few tips to help you find the right partner.

    How to Choose the Right MDR Services Provider

    The effectiveness of your MDR hinges on selecting the appropriate MDR services provider. We’ve outlined several key considerations that will guide you in finding the best fit for your MDR needs:

    Key Considerations

    • Expertise and experience: Look for providers with a proven track record in cybersecurity and specific expertise in your industry.
    • Technology stack: Ensure the provider uses the most up-to-date, best-in-class technologies for threat detection and response.
    • Scalability: The service should be able to grow with your organization and adapt to changing needs.
    • Compliance support: If you operate in a regulated industry, ensure the MDR provider can support your compliance requirements.
    • Pricing transparency: To avoid unexpected charges, look for providers that offer clear, detailed breakdowns of the cost of tools, analysts, and support.

    Assessing Technological Compatibility

    Check with potential providers to see if their tools will integrate smoothly into your technical setup without hindering productivity. Ensure that the provider offers APIs that integrate easily with your existing workflows.

    The ideal managed detection and response solution should be able to handle your current data volume and scale effortlessly as your business grows. For businesses leveraging cloud services, verifying that the MDR solution provides adequate coverage for your cloud environments is essential.

    Questions to Ask Providers

    When evaluating MDR providers, don’t be afraid to ask tough questions. Here are some essential ones to consider:

    1. How soon do you detect and respond to threats on average?
    2. Can you provide case studies or references from businesses similar to ours?
    3. What kind of training and support do you provide?
    4. How do you stay updated on the latest threats and attack vectors?
    5. What is your service’s incident response process?
    6. How do you handle data privacy concerns?
    7. What level of customization do you offer?

    These considerations will help you select a partner to strengthen your organization’s holistic cybersecurity management.

    Partner with TekStream for Expert MDR

    The need for robust, proactive cybersecurity measures cannot be overstated as cyber threats evolve in complexity and frequency. MDR offers a comprehensive, expert-driven approach to threat detection and incident response that can significantly enhance your organization’s security posture.

    At TekStream, we understand the critical role that MDR plays in modern cybersecurity strategies. That’s why we offer tailored MDR solutions that leverage the power of Splunk. We provide you with unparalleled visibility and round-the-clock protection for your digital assets.

    Ready to take your cybersecurity to the next level? Start your digital transformation today – schedule a security assessment with our MDR experts.

  • Lesser-known Splunk Enterprise features Part 1: Debug/Refresh

    Lesser-known Splunk Enterprise features Part 1: Debug/Refresh

    By Nate Hufnagel, Splunk Consultant II, Cybersecurity Engineering

    Intro

    The Splunk Enterprise platform supports several styling & behavior customizations that customers can take full advantage of. Some of these features are more obvious as your Splunk admin becomes more familiar with the UI, while others are not as obvious, even hidden. This two part series will discuss two of these hidden but powerful features of Splunk: debug/refresh and _bump.

    First up: debug/refresh. This feature can be used to reload all splunkd registered EAI (Extensible Administration Interface) handlers via REST call. Put more plainly – most of Splunk’s configs and static assets can be reloaded or refreshed without having to restart the splunkd service. This includes props, transforms, inputs, dashboards, and many others. The full list of endpoints can be found in the Splunk docs, or by executing debug/refresh. Let’s take a look at a few examples.

    In this first example, we’ll add a new search-time field extraction to props.conf and update our sourcetype without restarting Splunk. This is our list of fields before making any changes:

     A screenshot of a Splunk interface showing a pop-up window detailing the distribution of "ErrorMessage" field values, with a list of selected and interesting fields visible on the left pane.

    We’ll add another field called “ErrorMessage_2” to the sourcetype in props.conf. This can also be done through Splunk Web (Settings>Add Data)
    [<sourectype>]
    …
    EXTRACT-ErrorMessage_2 = ErrorMessage=(?<ErrorMessage_2>[^]]+)
    …

    Next, we’ll edit our Splunk Web URL to the following:
    http(s)://<host:mport>/debug/refresh
    …where “host” is the hostname and “mport” is the web port number (8000 in this case).
    Click “Refresh”, then it takes about a minute while all the endpoints reload.
    Once the reload is complete, we’ll see the “Entity refresh control page” in our browser, as well as a list of all endpoints that we’re successfully reloaded.

    A screenshot of a Splunk terminal showing the entity refresh control page, displaying the successful refreshing of Splunk configurations and EAI handlers.

    Now, we’ll navigate back to Splunk Web and run the same search as before: http(s)://<host>:<mport> (should still be logged in).

    A screenshot of the Splunk interface showing a detailed analysis pop-up window for the "ErrorMessage_2" field, displaying the top 10 values and their distribution.

    After running the same search, we see our new field!

    We can also reload more complex changes, like a custom app. For example, an app with a custom navigation bar and embedded HTML links can be installed and used without having to restart Splunkd!

    In this next example, our custom app is named “html-link”.  It contains on custom navigation tab called “Hyperlink” and an html link that can take us to an external site.  We’ll follow the same steps as above to achieve this without restarting Splunkd:

                  Install the app

                  Perform the debug/refresh

                  Navigate back to Splunk Web home

                  Launch app

    A screenshot of the Splunk Enterprise user interface showing the "Apps" dropdown menu open, listing various installed applications and options like "Search & Reporting" and "Manage Apps."

    Before installing the app

    A screenshot of a command line interface showing a tar command used to extract a file (html-blink_current.tgz) into the Splunk apps directory (/opt/splunk/etc/apps).

    Installing app

    A screenshot of the Splunk debug Entity refresh control page within a terminal, detailing the process for refreshing splunkd resources and EAI handlers.

    Performing debug/refresh

    A screenshot of the Splunk Enterprise interface displaying the Apps dropdown menu, which lists various applications, including a newly added "html-link" app, along with options to "Manage Apps" and "Search & Reporting".
    A screenshot of the Splunk Enterprise interface showing the "Hyperlink" tab active, with text instructing the user to click a link labeled "Debug-refresh-test-2" for learning more about regex.

    Navigating to/launching to app

    To learn more about what Splunk resources can be reloaded with debug/refresh, check out the link to the Splunk docs below. Be on the lookout for Part 2, where we’ll dive into the “_bump” feature.

    Link to Docs

    https://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/CustomizationOptions

    https://dev.splunk.com/enterprise/docs/devtools/customrestendpoints/customresteai

    Let us know what you think! And for more information on TekStream offerings, visit our Splunk Services page.

  • ITSI Content Packs

    ITSI Content Packs

    By Tyler Phillips, Splunk Consultant

    Lately, I have been delving into Splunk’s premium app ITSI. Splunk IT Service Intelligence is a KPI monitoring addition to Splunk, where we can use predictive analytics to see incidents before they happen and see the status of services that keep your company running smoothly. My colleague and I were working with a client and used content packs to get them started with ITSI.

    ITSI uses metric data from all types of places and servers to show us how these servers are running and what could be going wrong at any time. There is an add-on for Linux that I will be using today to show what I am trying to do. We need to set up the add-on to pull in metric data and install the Splunk App for Content Packs to do this. Now we can get to the ITSI setup.

    Let’s start with the basic ITSI Linux service. I installed the add-on and brought in the metrics data. I then went into ITSI Service Templates and created a service called Linux using the “OS KPIs – *nix (SAI)” Service Template. Now let’s look at this in the Service Analyzer.

    A screenshot of the Splunk IT Service Intelligence (ITSI) Service Analyzer dashboard, displaying Key Performance Indicators (KPIs) and the health status of a Linux service.

    Notice how no fields are filled out other than packet drops. This is filled out with 0 because there is no data there. The default Linux service is receiving no data because it does not recognize the fields that are feeding it.

    Now, let’s add the content pack “Monitoring Unix and Linux” to be able to read this data. Go to the Configuration tab and select Data Integrations.

    A screenshot of the Splunk IT Service Intelligence (ITSI) interface showing the "Configuration" dropdown menu, with the "Data Integrations" option highlighted.

    From here we can select the Content Library tab and find the “Monitoring Unix and Linux” content pack and select it. Then click proceed to install the content pack.

    An icon for the Splunk IT Service Intelligence (ITSI) content pack for "Monitoring Unix and Linux," with a green checkmark in the corner.

    Once this is installed we can go back to the Service Templates page in the Configurations tab and see a new Service Template called “Unix and Linux server health”. Let’s create a service from this. Select the template and click the “New Service From Template”, then we can name the service. For my example, I named it “Linux – Content Pack”.

    To get the service running let’s add an entity. Go to the service and select the Entities tab.

    There will be an empty field in the two entity rules automatically set up. We need to add a host to search data for. I added my laptop to this to pull in its data. I’ll be showing the page without my laptop hostname.

    A screenshot of the Splunk IT Service Intelligence (ITSI) interface showing the "Entities" configuration page for the "Linux - Content Pack", including defined entity rules for filtering hosts and data sources.

    Once you have added your host click save and then continue to save and enable. Click that and boom! We should be good to go!

    Let’s check the service analyzer to see the data coming in.

    A screenshot of the Splunk IT Service Intelligence (ITSI) Service Analyzer dashboard, displaying the health score (82.5) and a list of Key Performance Indicators (KPIs) for the Linux Content Pack.

    I had to wait a few minutes for the searches to run so seeing no results at first is fine. Just give it some time. This data also shows up on the Infrastructure Overview tab automatically. Let’s check it out.

    A screenshot of the Splunk IT Service Intelligence (ITSI) "Infrastructure Overview" dashboard, displaying a grid of various IT entity types such as Unix/Linux, Kubernetes, and VMware.

    This process is how I got started on a client project and ultimately gave them the information they needed to monitor their business. Content packs are a great way to get started with ITSI and show immediate data before setting up the full service analyzer tree and any predictive analytics that make ITSI so great for companies! More information on the Splunk services we offer can be found on our Splunk Services page

  • Set Up Dynamic Prior Quarter Time Range Selection In Your Dashboards 

    Set Up Dynamic Prior Quarter Time Range Selection In Your Dashboards 

    By Marvin Martinez, Team Lead, Automation Engineering

    Splunk Time Range inputs allow for a plethora of selections to accommodate any time range one’s heart desires. But what about when you need quick access to prior quarters and don’t want to have to keep dealing with clicking into the “Relative” section and selecting 1, 2, 3, or even 4 quarters ago? Of course, you could also manually set the Date Ranges in the “Date Range” section but that takes time and who’s got that kind of time nowadays?!

    A screenshot of a data platform's time range selection interface in a dark theme, displaying options for relative time periods and specific date ranges.

    Instead, you could set up a drop down list that automatically calculates what the last four quarters are, with neat labels to identify them, and returns the time range for that quarter for any searches in your dashboard!

    A screenshot of a dropdown menu in a dashboard interface, showing dynamic time range options for specific prior quarters (e.g., 2023 - Q3, 2022 - Q4).

    The labels above are all dynamic and will always be the last 4 quarters based on what the current date is. Let’s explore how to set up this drop down and then how to ensure the appropriate start and end dates are set so that all your panels can use them. First, the populating search for the drop down. Use the following search as the populating search for your dropdown list:

    | makeresults count=4 
    
    | streamstats count 
    
    | eval current_time = now(), current_year = strftime(current_time,"%Y"), current_month 
    
    = strftime(current_time, "%m") 
    
    | eval month_start = (count - 1) * 3 + 1, current_year = IF(current_month &lt; 
    
    month_start+3,current_year-1,current_year), label = current_year . " - Q" . count 
    
    | eval time_start = strptime(month_start . "-01-" . current_year,"%m-%d-%Y"), time_end
    
    = relative_time(time_start,"+3mon@mon") 
    
    | eval time_start_human = strftime(time_start,"%m/%d/%Y %T") 
    
    | eval time_end_human = strftime(time_end,"%m/%d/%Y %T") 
    
    | sort - label 
    
    | table label time_start time_end time_start_human time_end_human 

    The search above calculates the last four quarters but, if you notice, that’s only limited by the count of the makeresults command at the top. Feel free to extend it and go back a bit further if you need to. The search creates 4 entries and numbers them using the streamstats command. Once numbered, it extracts some of the date information (year, month, etc.) and does a little math to calculate where in the year (i.e. quarter) it is currently. Based on that, it generates the start date for each row (i.e. quarter). Once configured, it just sorts them accordingly and returns the field with the start date of the quarter (more on this in a bit) as the value for the dropdown list item and the label for the dropdown list in the “label” field.

    So how do both the start AND end time ranges get set if only the start time is available as the value? Well, a little logic application is all it takes! Note that, in this dashboard, there was an option for a “custom” time range in which an actual time input is able to be selected to define any other custom time range desired as well. Feel free to reach out for more information on how to implement that, or keep your eyes out for a future blog on this topic! Enough teasing and back to setting the end time! Set up a change handler for your dropdown list as shown below:

          <change> 
    
            <condition match="$form.tok_time_range_select$!=&quot;custom&quot;"> 
    
              <unset token="tok_show_custom_time">true</unset> 
    
              <set token="tok_start_date">$tok_time_range_select$</set> 
    
              <eval token="tok_end_date">relative_time($tok_time_range_select$,"+94d@mon")
    </eval> 
    
            </condition> 
    
            <condition label="Custom"> 
    
              <set token="tok_show_custom_time">true</set> 
    
              <set token="tok_start_date">$form.tok_time_range.earliest$</set> 
    
              <set token="tok_end_date">$form.tok_time_range.latest$</set> 
    
            </condition> 
    
          </change> 

    The change handler checks to make sure the selected option isn’t “Custom” and does a few things:

    • It unsets the token to show the custom time range selector to ensure that gets hidden away
    • It sets the tok_start_date token which is what all the dashboard panel searches will be using as their start date.
    • It sets the tok_end_date token which is what all the dashboard panel searches will be using as their end date. Rather than just grabbing it from the value like the start date could, it needs to be quickly calculated via an eval. The eval simply does a relative time of the start date token and adds 94 days (to ensure even 3 months of 31 days wouldn’t prevent it from pegging the end date to the start of the 4th month!) and then pegs it to the beginning of the month.

    There you have it! Now, any panels in your dashboard (or better yet, your base search!) can just use the “tok_start_date” and “tok_end_date” tokens as their earliest/latest values and you can easily switch between quarters in your dashboard without having to worry about manually selecting x number of quarters ago or having to go in and define specific months!

    Read more about TekStream Splunk Services