Tag: blog

  • Software That Grows With Your Business

    Software That Grows With Your Business

    Modernizing Applications to Prevent Growing Pains and Increase Resilience

    Traditional application development methods are becoming increasingly obsolete. To stay competitive, you need to develop flexible and adaptable applications that easily integrate emerging technologies, such as AI/GenAI, without requiring a complete overhaul every time, regardless of whether the environment is on-premises, cloud-native or hybrid.

    Modern application development addresses this need for agility. It enables you to build a flexible architecture that scales and evolves as business needs change and new capabilities and functionalities become available. And it provides the necessary framework to adapt swiftly, irrespective of the service delivery model or the development environment.

    Benefits

    What are the major benefits you’ll get from modernizing your applications? Here are the top four benefits that make it best for building your middleware and mission-critical applications.

    Efficient Launch Timing & Market Responsiveness

    The main benefit of the modern app approach is its ability to radically simplify the development process. It is built on agile practices, cloud platforms, microservices architecture and continuous integration and delivery/continuous deployment (CI/CD) to enable faster and more efficient development cycles.

    Modern application development significantly reduces the time from concept to deployment. This rapid development and deployment cycle enables businesses to respond quickly to market changes and user needs, giving you a competitive edge. Leveraging this flexible modality also helps you access and act upon real-time data to make timely decisions and stay responsive to market dynamics.

    Unlike traditional application development practices, where changes can be overwhelming and time-consuming, a modern application practice facilitates rapid deployment and iteration. This makes the development process faster and more flexible.

    Future-proofing & Secure Scalability

    Software security is at the heart of the application modernization methodology. It leverages the latest security practices to deploy software in a safe environment, ensuring that applications are safe from current threats and adaptable to future security challenges. Adopting a modern development process ensures your applications are tailored to current business needs and can accommodate future advancements and scalability. This future-proofing aspect means that applications can evolve alongside the business. By adopting modern application development, especially in cloud-based service delivery models, you can move away from capital-intensive IT investments toward more flexible operational costs.

    Enhancing Flexibility & User Experience

    Applications developed with this approach are inherently flexible and scalable, catering to various user needs and business scenarios. This flexibility is crucial for user-centric and middleware applications, which help connect data sources and facilitate seamless operations within an organization.

    Modern application development enables businesses to adapt quickly to change, whether market trends, customer feedback or technological advancements. This agility is vital to maintaining a competitive edge in a fast-paced digital environment.

    Opening Doors to Advanced Technologies

    Modern applications provide a foundation for integrating advanced technologies like machine learning and the Internet of Things (IoT). By embracing this cloud-first strategy, businesses can easily incorporate new technologies into their applications, unlocking advanced capabilities and insights. This foundation keeps the development doors open for emerging technology.

    Getting Started

    If you know you’d like to explore application modernization, here are some criteria considered to be important when choosing the partner you work with.

    Integrating Advanced Technologies & Best Practices

    Find a partner who operates as a one-stop shop, covering all facets of application development. This includes initial concept, development, deployment and ongoing support, offering a seamless and integrated service experience. We combine our extensive expertise with the latest security and fault tolerance best practices. By integrating advanced technologies like DevOps/CI/CD, Gen AI and no-code/lowcode, we help you design innovative and robust applications.

    Validated Expertise for Your Assurance

    The right partner offers the technical mastery to ensure agile delivery without compromising quality. TekStream demonstrates this approach to help you get significant savings on the total cost of ownership, a crucial factor for any business. The assurance of working with certified experts in AWS serverless, serverless containers and Kubernetes-based applications adds an extra layer of confidence in your project’s success.

    Financial & Strategic Flexibility

    With the capability to access additional funding options like the AWS partner funding program, TekStream offers you access to financially savvy solutions that can bring tens of thousands to hundreds of thousands of dollars to your project. We focus on creating applications that are effective today but scalable and adaptable for tomorrow. This foresight is crucial for maintaining the relevance and efficiency of your applications in the long term.

    The TekStream Advantage

    Our ability to quickly understand an organization’s unique challenges and objectives stands out. This approach is not just about deploying the latest technologies; it involves engaging closely with both technical and business stakeholders, which is part of the TekStream advantage. Such collaboration ensures that each decision made in the development process is strategic and aligned with the long-term vision of the business to develop the best architecture possible. Maintaining this perspective is crucial, especially for organizations that might not have the capacity or expertise to embrace modern app development entirely.

  • Not Enough Space? Rotate Through Your Dashboard Panels Automatically

    Not Enough Space? Rotate Through Your Dashboard Panels Automatically

    By Marvin Martinez, Team Lead, Security Operations

    Splunk dashboards allow for great flexibility and can provide many ways to visualize your data. Sometimes, however, you may need to ensure you can fit everything on one non-scrollable screen. Perhaps you’re in a SOC with a main screen and need some different panes to display at specific intervals? What if you need to cycle through a set of data between different time ranges like the last 24 hrs, 7 days, and 30 days? In these situations, it would be very helpful to be able to have a dashboard that automatically rotates the desired panels on specific time intervals, not unlike a fast food menu screen or those digital billboards you frequently see on the interstate!

    In the example we’ll use for this article, I’ll demonstrate how to configure a dashboard to display an Attack Map in two separate ways. The first view will contain a full screen attack map with all of the different sources in one single map to provide a comprehensive view. The second view is a broken out set of panels that shows each individual source/group in its own panel with a dedicated attack map for added detail. The Missile Map app that contains this attack map visualization used below can be found on Splunkbase.

    View 1

    Cybersecurity attack map showing global data flows and threat origins in a single interactive panel.

    View 2

    Rotated Splunk dashboard displaying four grouped attack maps with segmented threat visualization panels.

    These two views will cycle automatically based on a specified time interval defined within a global search in your dashboard. There are a few tokens to ensure you set up correctly but, once set up as needed, your dashboard will cycle through the two configured views (sets of panels) on its own for use in any monitor on a wall or other constantly monitored screen.

    The snippet of dashboard XML code responsible for the setup is below, with a full detailed explanation below:

       <search> 
    
        <query>| makeresults count=1 
    
    | eval test = IF("global" = "global","individual","global") 
    
        </query> 
    
        <done> 
    
          <eval token="panelView">IF($panelView$ = 
    
    &quot;global&quot;,&quot;individual&quot;,&quot;global&quot;)</eval> 
    
          <set token="form.panelView">$panelView$</set> 
    
          <eval token="refreshCount">$refreshCount$ + 1</eval> 
    
        </done> 
    
        <refresh>15s</refresh> 
    
        <refreshType>interval</refreshType> 
    
      </search> 
    
      <fieldset submitButton="false"> 
    
        <input type="text" token="panelView" depends="$tok_hide$"> 
    
          <label>field1</label> 
    
          <initialValue>global</initialValue> 
    
        <change> 
    
          <condition value="global"> 
    
              <set token="globalView">true</set> 
    
              <unset token="individualView"></unset> 
    
          </condition> 
    
          <condition> 
    
            <unset token="globalView"></unset> 
    
            <set token="individualView">true</set> 
    
          </condition> 
    
        </change> 
    
        </input> 
    
      </fieldset> 

    Components

    The components of this setup are as follows:

    – Search to detect what view is currently being displayed and what the next one will be, as well as to define what the refresh interval will be

    – A hidden input to allow for catching the resulting value and setting the appropriate tokens for view hiding/showing.

    – Setup your rows (or panels) with the appropriate depends settings to leverage the appropriate tokens to ensure they are shown only when desired.

    First, the initial search. Set this search up at the top of your dashboard.

    <search> 
    
        <query>| makeresults count=1 
    
    | eval test = IF("global" = "global","individual","global") 
    
        </query> 
    
        <done> 
    
          <eval token="panelView">IF($panelView$ = &quot;global&quot;,&quot;individual&quot;,&quot;global&quot;)</eval> 
    
          <set token="form.panelView">$panelView$</set> 
    
          <eval token="refreshCount">$refreshCount$ + 1</eval> 
    
        </done> 
    
        <refresh>15s</refresh> 
    
        <refreshType>interval</refreshType> 
    
      </search> 

    The query is just a generic makeresults command to return some output value but it’s being leveraged to set the token value of the hidden input. This is to ensure that you don’t end up with an infinite loop by trying to set the token of an input within itself. Use the done event handler to set the token of the hidden input (“panelView” in my example) (details below) within it. Use an eval to set the token appropriately based on the value of the “panelView” input currently (i.e. if “global” currently, set it to “individual” and vice versa). The refresh property is what defines how often the panels/views will rotate between displaying. You can statically set it here or even define it using a token from an input, if desired, to make that refresh interval easily customizable.

    As far as the input is concerned, create a text box input and set the “depends” property on it to a token you don’t intend on setting so that it is always hidden (i.e. “$tok_hide$”). Add a change condition so you can set, and unset, appropriate tokens based on the value of the input. This is where the magic happens! When the value of the token is “global”, in this case, it sets the globalView token and unsets the individualView token. This will hide the individual panels and display the global one. The default condition after that is executed when the value is anything other than “global”, which is sufficient in our scenario but you may need additional explicit conditions if you have more than two views in your dashboard. Note how the set/unset is just reversed from the first one to ensure only one is set at any given time.

    <fieldset submitButton="false"> 
    
        <input type="text" token="panelView" depends="$tok_hide$"> 
    
          <label>field1</label> 
    
          <initialValue>global</initialValue> 
    
        <change> 
    
          <condition value="global"> 
    
              <set token="globalView">true</set> 
    
              <unset token="individualView"></unset> 
    
          </condition> 
    
          <condition> 
    
            <unset token="globalView"></unset> 
    
            <set token="individualView">true</set> 
    
          </condition> 
    
        </change> 
    
        </input> 
    
      </fieldset> 
    
     

    Finally, it’s time to configure your rows/panels with the appropriate depends property to hide/show panels when necessary, as shown below. Set the value of each to be the token that will show the panel/row.

      <row depends="$globalView$"> 

    Save your dashboard and enjoy the automatic cycling between your panels with no engagement from a human!

  • Announcing Amazon Q – GenAI

    Announcing Amazon Q – GenAI

    By Jay Almers, Senior Solutions Architect

    At AWS re:Invent 2023, Amazon announced the addition of an exciting new service that has been added to their already-impressive AI portfolio called Amazon Q. What makes this service so intriguing, especially in today’s world of GenAI, or Generative Artificial Intelligence, is the data sources the AI models are trained on.

    I asked one of the most notable GenAI systems available to the general public, ChatGPT (the chat-based Generative AI solution developed by OpenAI) to describe the data sources its models were trained on. These data sources include a wide selection of books from numerous genres and time periods, websites that cover topics like news, science, art, culture and forums. It also sourced its data from scientific papers, including technical and scientific information from many different fields and areas of study, as well as “common crawl data” and “other textual sources” which are comprised of newspapers, magazines, articles and other written content available on the Internet. An important thing to note about ChatGPT and similar solutions is that its responses may not include the most accurate or up-to-date data as there is a specific cutoff date for which it has data; as of this post, this cutoff date is April 2023. That’s where Amazon Q enters the conversation.

    Screenshot of ChatGPT explaining the data sources used for training GPT models, including books, websites, scientific papers, Common Crawl data, and other textual sources—highlighting transparency in AI model training for generative AI tools like Amazon Q.

    A first person response from ChatGPT

    So, how is Amazon Q different?

    Much like ChatGPT and other GenAI systems out there, Amazon Q takes a starting question (prompt) and generates and returns a response based on the data sources its models had been trained on. Using natural language processing, the AI solution is usually able to interpret and understand the context and subject matter being asked of it. It also has a concept of tonality, complexity, or if it needs further clarification because the initial prompt was too vague. But this is where Amazon Q seemingly splits away from the other GenAI solutions that are available today. According to AWS, you can use Amazon Q to have conversations, solve problems, generate content, gain insights and take action by connecting to your company’s information repositories, code, data, and enterprise systems. I emphasized this last part because of this major shift how the solution is trained. Rather than OpenAI’s data sources being derived from the “Public Web”, Amazon Q can be connected to an organization’s internal documents, code, and proprietary information so that the information it returns is organization centric.

    Imagine the Human Resources department of your organization needing to sift through countless procedural documents to change a VERY legally problematic occurrence of the word “and” to “or”. Utilizing an AI solution that has been trained on your organization’s documents to do the monotonous task of sifting through that information for you would be a tremendous time saver.

    Now imagine you have lost a couple of key software engineers or application developers and their documentation is not as polished as we’d all like. Having a solution that could be trained on your own proprietary source code could provide you with a deeper understanding of the code as well as provide your current and future developers with the starting point they are looking for where the documentation is lacking.

    If Amazon Q is connected to our data, how do we keep it secure?

    Amazon Q, like every other AWS service, follows a shared security model where AWS is responsible for protecting all the infrastructure that runs the AWS Cloud globally and the customer is responsible for securing and protecting the content that runs within the AWS Cloud. Amazon Q uses “data source connectors” to access and crawl your organization’s data, such as Confluence Wikis, GitHub repositories, and Salesforce instances to name a few, for use in its training and responses. Using these connectors stores credentials in AWS Secrets Manager and IAM policies to control access to these secrets.

    It is important to note that AWS warns users and organizations to follow general security best practices as it pertains to unintentional disclosure of sensitive information:

    “We strongly recommend that you never put confidential or sensitive information, such as your customers’ email addresses, into tags or free-form text fields such as a Name field. This includes when you work with Amazon Q or other AWS services using the console, API, AWS CLI, or AWS SDKs. Any data that you enter into tags or free-form text fields used for names may be used for billing or diagnostic logs. If you provide a URL to an external server, we strongly recommend that you do not include credentials information in the URL to validate your request to that server.”

    We are certainly just getting started in the world of Generative AI and with all new technologies, there’s still a lot of refinement that needs to be done as use-cases and enhancements are developed. Artificial Intelligence is here to stay and what will end up setting individuals and organizations apart will be how they choose to approach AI; resist it and be swallowed by the wave or embrace it and use it as a tool to make better use of our most precious and valuable commodity – time.

  • Splunk Index Earliest and Index Latest

    Splunk Index Earliest and Index Latest

    By Jay Young, Senior Splunk Consultant

    In Splunk, _index_earliest and _index_latest are two special time-based SPL and SPL2 search constraints that help you specify a time range based on indexed time and not event time for your search within a specific index. These constraints are useful for limiting the scope of your search to a specific a time and improving the efficiency of your searches. They also help find events they may have been indexed with incorrect event time stamps.

    _index_earliest

    The _index_earliest constraint specifies the earliest time that your search should begin when searching within a specific index.

    You can think of it as setting the starting point in time for your search within the specified index.

    This constraint is particularly useful when you want to focus on a specific time range within an index, allowing you to exclude data that’s outside that range.

    _index_latest

    The _index_latest constraint specifies the latest time that your search should end when searching within a specific index.

    It sets the ending point in time for your search within the specified index.

    Like _index_earliest, _index_latest helps you narrow down your search to a specific time frame, excluding data that falls outside of it.

    Reference materials can be found on the Splunk SPL Search Manual

    Example 1

    Suppose you have an index called “web_logs” and you want to search for events between 10:00 AM and 11:00 AM on a specific day.

    index=web_logs source=”/var/log/access.log” | search

    _index_earliest=”10:00:00″ _index_latest=”11:00:00″

    Example 2

    To search for events in the “security” index that occurred between October 1, 2023, and October 15, 2023, you can use the constraints like this:

    index=security | search _index_earliest=”10/01/2023:00:00:00″

    _index_latest=”10/15/2023:23:59:59″

    Example 3

    You can also use relative time expressions. For instance, to search for events within the last 24 hours in the “application” index:

    index=application | search _index_earliest=-24h _index_latest=now

    Conclusion

    These examples demonstrate how to use _index_earliest and _index_latest to specify time ranges when searching within specific indexes in Splunk. This can help you focus on relevant data and improve efficiency and find events that may have been ingested with an event timestamp that was out of the normal date and time range.

  • How to Dynamically Extract and Set Field Names in Splunk

    How to Dynamically Extract and Set Field Names in Splunk

    By Brent Mckinney, Splunk Team Lead

    This blog demonstrates how to dynamically set field names based on values in your Splunk events, and set them to corresponding field values. This requires a unique configuration, as opposed to doing traditional field extractions with static field names.

    Let’s Get Started

    For this example, let’s say we have the following events with the sourcetype test_sourcetype:

    11/30/2023 01:34:30 field_name=”response_code” field_value=”200″

    11/30/2023 02:30:39 field_name=”response_code” field_value=”200″

    11/30/2023 03:36:47 field_name=”response_code” field_value=”404″

    11/30/2023 04:39:31 field_name=”response_code” field_value=”500″

    11/30/2023 05:34:55 field_name=”response_code” field_value=”200″

    11/30/2023 06:32:21 field_name=”response_code” field_value=”200″

    11/30/2023 07:39:54 field_name=”response_code” field_value=”200″

    11/30/2023 08:38:29 field_name=”response_code” field_value=”200″

    11/30/2023 09:36:34 field_name=”response_code” field_value=”404″

    11/30/2023 10:31:01 field_name=”response_code” field_value=”500″

    By default, Splunk will extract these fields as follows:

    field_name = response_code

    field_value = 200

    But what if we want the fields extracted like this?

    response_code = 200

    Rather than creating a custom, static field name, and extracting a corresponding value, Splunk provides the ability to extract both the field name AND value, and apply them accordingly. This is done using field transformations applied to our sourcetype.

    Field Transformations

    The first thing we need to do is create a regular expression to capture the fields of interest. Our initial regex looks like this:

    field_name=”(?<field_name>w*)”sfield_value=”(?<field_value>w*)”” 

    This regex extracts the desired fields, but by itself, sets them in 2 fields, field_name and field_value respectively. In order to have the value of field_name be our field name, and the value of field_value be the corresponding field value, we need adjust our regex to use specific syntax that Splunk expects for the transformation. This involves using KEY and VAL to extract and correlate the field/value pair.

    Our regex now looks like this:

    field_name=”(?<_KEY_1>w*)\sfield_value=”(?<_VAL_1>w*)”” 

    The value of <string> specified in _KEY_<string> and _VAL_<string> will ensure the field name extracted is set to the field value extracted. In order to implement we can add our transformation:

    Navigate to Settings > Fields > Field transformations and provide the following then Save.

    Name: testing_extraction 

    Type: regex-based 

    Format: leave this blank 

    Regular expression: field_name=”(?<_KEY_1>w*)”sfield_value=”(?<_VAL_1>w*)” 

    Source Key: _raw 

    Next we set our field extraction to the appropriate sourcetype, to use the above transformation. To start, navigate to Fields > Field extractions:

    Name: test_extraction

    Apply to sourcetype named test_sourcetype

    Type: Uses transform

    Extraction/Transform: testing_extraction

    The above values should match the sourcetype of the data you are extracting these fields from. The value of Extraction/Transform MUST match the name of the Field Transformation. Once saved, running a search on the sourcetype will show the field names and values extracted and available to filter on.

    Note, this can NOT be done directly in SPL at search time. It must be done via field transformation. You may also need to check permissions on both the field transformation AND field extraction so that users can use the new fields.

    You should now be able to dynamically set field names based on values in your Splunk events, and set them to corresponding field values. As always, we are available if you have any questions – just fill out the form below:

  • Cybersecurity Just Got Personal – My County Was Held Hostage

    Cybersecurity Just Got Personal – My County Was Held Hostage

    By Judd Robins, Executive Vice President, Sales & Marketing

    Renewing my car tag should have been quick. But a cyberattack unexpectedly compromised Atlanta, GA’s (Fulton County) digital infrastructure. It paralyzed the local government’s digital systems, making routine tasks like paying water bills, accessing records and renewing a car tag impossible.

    The financial impact was steep, with an estimated $10-15 million cost to restore services plus another $10 million to harden the county’s cybersecurity infrastructure against future attacks (according to WSB Channel 2). As a local resident and cybersecurity executive, this attack hit close to home.

    The Escalating Attack on Public Data

    Cyberattacks, like the one in Fulton County, have become commonplace. Many public sector organizations are particularly vulnerable due to aging IT applications and very tight budgets.

    In 2023, 2,365 reported cyberattacks affected over 343 million victims. This represents a staggering 72% increase in data breaches since 2021, which previously held the record for the most breaches. And there’s more:

    These statistics highlight the escalating scope of cyber threats and the urgent need for enhanced security solutions — solutions that my team at TekStream provides to safeguard private and public organizations, like Fulton County, from debilitating cyberattacks.

    A Call to Action: How Organizations Like Fulton County Can Protect Themselves

    No organization — public or private — is 100% secure. Many struggle to stay ahead of cyber threats, grapple with workforce shortages and often lack the necessary security coverage for their specific environments. At TekStream, we’ve been tackling these challenges for years and have tailored our cybersecurity solutions to address them effectively.

    Using our Visibility, Fidelity and Automation (VFA) framework within a collaborative Splunk security environment, our MDR services assess and enhance clients’ security maturity. This strategic approach allows us to identify critical areas that require immediate attention, ensuring that security measures are precisely aligned with each organization’s unique needs.

    One of the key tools in our solution set of particular interest to government and educational IT departments is our deployment of a Shared Security Operations Center (Shared SOC). This innovative model allows multiple public sector teams to collaborate, sharing resources and intelligence.

    The Shared SOC not only broadens the scope of threat detection but also enhances the collective response capabilities, significantly strengthening the cybersecurity posture across organizations at a reduced cost of operations. Coincident with deploying a Shared SOC is our approach to addressing the significant gap in skilled cybersecurity professionals.

    Our SOC capabilities include providing supervised on-the-job training (OJT) of client personnel by our experienced MDR specialists, rapidly upskilling new entrants and enhancing the abilities of current team members. This initiative helps overcome the severe shortage in skilled cybersecurity talent and prepares teams to effectively counter and manage evolving cyber threats.

    An example of this model in action is the work we have done with Louisiana State University (LSU ) to set up their cybersecurity infrastructure through a Shared SOC. This collaborative effort between LSU, the university system and the state, has allowed LSU to significantly enhance its threat detection and response capabilities while developing the next generation of cybersecurity talent.

    At TekStream, we’re constantly working with clients to deploy creative solutions to enhance public sector cybersecurity cost effectively. Our goal is simple: to enable organizations to respond to threats while proactively anticipating and managing them.

    The results ensure that public entities are well-equipped to protect their critical digital infrastructures and the services provided to the constituents they serve.

    Securing Tomorrow

    Cyberattacks, like the one we experienced in Fulton County, demonstrate the vulnerability of our digital infrastructures. They disrupt essential services and personal safety.

    As part of a team that works hard to thwart these attacks, my car tag nightmare was a reminder of the importance of the work we do. It’s also a call for all public sector entities like Fulton County to aggressively seek solution partners like us to prevent the massive costs and disruptions that all the citizens of Fulton had to endure.

    To learn more about options to secure your cyber assets, read our guide, The Cybersecurity Paradox: Billions Spent but Breaches Boom. Or contact us for an evaluation of how your organization can cost-effectively secure its applications and better serve its constituents with a customized MDR solution.

  • Best Practices for Writing Efficient Splunk SPL Queries

    Best Practices for Writing Efficient Splunk SPL Queries

    By David Allen, Senior Splunk Consultant

    Data is the lifeblood of any organization, and harnessing its insights is paramount for making informed decisions. In the realm of data analytics, Splunk stands out as a powerful tool for searching, monitoring, and analyzing vast datasets.

    However, as datasets grow in size and complexity, the efficiency of your Splunk Search Processing Language (SPL) queries becomes a critical factor in unlocking the true potential of your data.

    In this blog post, we delve into the art of writing efficient SPL queries—strategies and best practices that not only enhance the speed of your searches but also contribute to a more streamlined and effective Splunk experience. Whether you are a seasoned Splunk veteran or just embarking on your data analytics journey, understanding how to optimize your SPL queries is a valuable skill set.

    In Splunk SPL, data is stored in indexes and the index command is used to specify the index or indexes from which you want to retrieve data. It is best practice to start your query with this command unless you are using another generating command. Here are scenarios and use cases where you would use the index command:

    Data Segmentation

    When your Splunk environment contains multiple indexes, you use the index command to segment your search to a specific index or a set of indexes. This is essential for isolating your search to a particular data source.

    index=your_index sourcetype=your_sourcetype

    Efficient Searches Across Indexes

    If you need to search across multiple indexes, you can use the index command to specify a list of indexes. This is useful when your data is distributed across different indexes based on sources or use cases and ensures that Splunk only scans the relevant indexes, improving the efficiency of your queries.

    index=index1 
    OR 
    index=index2

    Remember that the index command is a fundamental component of SPL and is often used in conjunction with other commands and criteria to tailor searches to your specific needs. Whether you’re conducting ad-hoc searches or building complex queries for monitoring and reporting, incorporating the index command allows you to precisely target and retrieve the data you require.

    After using the index command in Splunk SPL to specify a particular index or set of indexes, you can further refine and reduce the dataset using additional SPL commands and criteria. Here are several techniques to narrow down and focus your search:

    Specify Sourcetype or Source

    After filtering by index, you can refine your search by specifying a particular sourcetype or source. This is particularly useful when you want to focus on a specific type of data within the selected index.

    index=your_index sourcetype=your_sourcetype

    Time Range Restriction

    Limit the search to a specific time range using the earliest and latest parameters. This reduces the volume of data processed, enhancing search performance.

    index=your_index sourcetype=your_sourcetype earliest=-24h latest=now

    Field-Based Filtering

    Utilize field-based filtering to narrow down your search results based on specific field values. This is effective when looking for events that match certain criteria.

    index=your_index sourcetype=your_sourcetype field_name=value

    Combining Commands for Further Filtering

    index=your_index sourcetype=your_sourcetype 
    | stats count by field_name 
    | search count>100 
    | table field_name, count
    

    Advanced Field Filtering with eval

    Use the eval command to create calculated fields that meet specific conditions. This is helpful for advanced filtering based on complex expressions.

    index=your_index sourcetype=your_sourcetype 
    | eval new_field=if(old_field > 100, "High", "Low") 
    | search new_field="High"
    

    Regular Expression (Regex) Filtering

    Use regular expressions to filter events based on complex patterns or substrings. This is useful when you need to match events that follow a specific format. You can use a regex command for example to keep only the results that match a valid email address like [email protected].

    index=your_index sourcetype=your_sourcetype 
    | regex email="^([a-z0-9_.-]+)@([da-z.-]+).([a-z.]{2,6})$"
    

    Splunk Architecture Options

    In this next section we will look at the different architectures in Splunk and how we can take advantage of those architectures to write even more efficient SPL. But first, a little background information explaining the differences between a standalone and distributed environments.

    In Splunk, the terms “standalone” and “distributed” refer to different deployment architectures that organizations can adopt based on their data processing and scalability requirements. Let’s explore the key differences between a standalone and distributed environment in Splunk:

    Diagram comparing Splunk standalone vs. distributed environments, with icons illustrating single vs. multiple host configurations.

    Standalone Environment

    Single Instance:

    In a standalone environment, there is a single Splunk instance. This instance performs all functions, including indexing, searching, and serving the user interface.

    Indexing and Searching on the Same Instance:

    In a standalone deployment, the indexing and searching processes take place on the same machine. This simplicity is beneficial for smaller use cases but can be a limiting factor as data volumes increase resulting in slower SPL execution times.

    Distributed Environment

    Multiple Components:

    In a distributed environment, the Splunk deployment is composed of multiple components, each responsible for specific functions. Common components include indexers, search heads, and forwarders.

    Indexing and Searching on many Instances:

    Since every distributed environment contains more than one indexer and possibly more than one search head, searches can be distributed across all the indexers to effectively run your SPL in parallel on the indexers and each indexer runs the same SPL on its dataset. This results in lightning fast execution times compared to running the same SPL on a Single Instance.

    But this potential gain of the distributed environment can only be utilized if the SPL commands are arranged for maximum efficiency. This is because only certain commands can be run on the indexers and other commands can only be run on the search heads and once one of the search head only commands is reached then all subsequent commands must be run on the one search head which reduces efficiency. Unfortunately, search head commands are not distributed across all search heads in search head cluster environments.

    Distributable Streaming Commands

    This type of command can run on the indexers. Here are the most common distributed streaming commands….

    Graphic listing common SPL transformation commands including eval, fields, rename, replace, and regex.

    But as not all Splunk commands are distributable streaming commands, it is important to make sure that all preceding commands are distributable streaming commands. This will keep the SPL running on the indexers.

    Transforming Commands

    This type of command can only be run on search heads;

    Graphic listing SPL aggregation commands including chart, stats, rare, top, and timechart.

    As you can see in order to accomplish one of these commands the instance running this command must have the entire dataset and once one of these commands is reached, then all the results from the indexers are sent to the one search head which from that point on completes the remaining query regardless of the type of command used.

    So it is important as you write your SPL to run as much as you can on the indexers as long as possible before using a transforming command. Because once a transforming command is used all subsequent commands are run on the search head and the benefit of parallel processing is lost.

    Execution Speed Calculation

    You can always check to see how long it takes to run your search by looking at the Job Inspector. Here is how to do that:

    Screenshot of Splunk’s Job menu with the dropdown options to edit, inspect, or delete a job.
    Screenshot showing job inspector summary indicating 0 events scanned and the query completing in 0.067 seconds.

    In conclusion, mastering the art of writing efficient Splunk SPL (Search Processing Language) is pivotal for unlocking the full potential of this powerful analytics platform. Efficient SPL not only accelerates search performance but also enhances the overall user experience, enabling quick and accurate insights into your data.

  • Predict Your Incident Tickets With Splunk MLTK 

    Predict Your Incident Tickets With Splunk MLTK 

    Experimenting with Forecast Time Series Workflow

    By Kamal Dorairaj, Senior Splunk Consultant

    This blog details a step-by-step process on how to create and run a prediction model with Splunk MLTK. The use case explained is specifically showing how to predict the number of incident tickets created for an Operations Team during a busy holiday time, so the team can prepare for the workload. Here are my guidelines for the prediction model.

    Experiment

    The experiment predicts the number of incident creation tickets for each month in Salesforce, for the next five months. The Forecast Time Series experiment assistant workflow is used for this use case. The FTS Assistant predicts the next value in a sequence of time series data, and the result includes both the predicted value and a measure of the uncertainty of that prediction.

    Follow these steps to create a Forecast Time Series Experiment:

    Go to Apps -> Splunk_ML_Toolkit -> Experiments.

    Click on Create New Experiment

    Select Forecast Time Series from the dropdown

    Complete the Experiment Title and Description and click Create. (Both the name and description can be edited later if needed)

    Splunk Machine Learning Toolkit Experiments page showing multiple available experiment types including Smart Forecasting, Smart Outlier Detection, and Clustering.
    A dropdown menu in Splunk MLTK showing options for creating a new experiment, with Forecast Time Series highlighted among other predictive options.
     Blank forecast experiment setup screen in Splunk MLTK showing options to select an algorithm, field to forecast, and configure method and intervals.

    Build The SPL

    Creating the SPL is the 80% of the work. The SPL should filter the condition appropriately to a specific numeric field value. The below SPL is an example where the search scans thru the past four years of salesforce incident tickets count through the input lookup with a one month span. Develop similar SPL based on your data sources.

    [| INPUTLOOKUP SALESFORCE_INDEX.CSV ] SOURCETYPE=”SFDC:CASE” CASENUMBER=* STATUS!=DUPLICATE | EVAL TEMP=STRPTIME( CREATEDDATE, “%Y-%M-%DT%H:%M:%S.%Q”) | EVAL _TIME=TEMP | TIMECHART SPAN=1MON DISTINCT_COUNT(CASENUMBER) AS “TICKETS COUNT”

    Forecast experiment in Splunk MLTK with a SPL query entered for analyzing duplicate Salesforce case tickets, including eval and timechart functions.

    Algorithim

    Select the Kalman Filter algorithm from the Algorithm dropdown. A good understanding of each algorithm is needed to use the algorithm that works best for our use case. The Kalman Algorithm considers subsets of features such as local level (an average of recent values), trend (a slope of line that fits through recent values) and seasonality (repeating patterns).

    From the Field to Forecast list, select the Tickets Count field which we want to forecast for this use case.

    Next, specify 5 in the Future Timespan field, which is 5 months of future data we want to forecast.

    Then, specify 95 in the Confidence Interval field, which is the percentage of the future data you expect to fall inside of the confidence envelope.

    All other fields are optional and can be used based on the use case.

    Completed forecast experiment setup in Splunk MLTK showing a populated query and configuration for Kalman Filter with a 95% confidence interval.

    Forecast

    Click on Forecast. The math behind the algorithm gets applied on the search results and will produce the results of the next five-month prediction count.

    Draft version of a forecast experiment for Salesforce duplicate tickets in Splunk MLTK, ready to be saved or executed with pre-filled parameters.
    Splunk MLTK forecast visualization with a line graph showing ticket count over time, shaded confidence intervals, and performance metrics like R² and RMSE.

    Definition of The Variables

    After you forecast a time series, review your results in the following tables and visualizations.

    Table explaining forecast result metrics in Splunk, including definitions for R² Statistic, Root Mean Squared Error, and Prediction Outliers.

    Run The Model

    Click on the Show SPL to generate a new modal window/overlay showing the search query you used to forecast. Copy the SPL for future use in other aspects of your Splunk environment.

    SPL code preview popup in Splunk MLTK showing the complete forecast command used to calculate and visualize predicted ticket counts.

    Once you are getting valuable results from your experiment, save it. Saving the experiment results in the following actions:

    Assistant settings saved as an experiment knowledge object. 
    The Draft version saves to the experiment Listings page. 
    Any affiliated scheduled trainings and alerts update to synchronize with the search SPL and trigger conditions. 

    Load a saved experiment by clicking the experiment name. 

    Within the experiment click  Open in Search  to generate a new search tab for this same dataset. This new search will open in a new browser tab, away from the assistant. This search query uses all data, not just the training set. You can adjust the SPL directly and see results immediately. You can also save the query as a Report, Dashboard Panel or Alert.

    Line and bar chart from a Splunk dashboard titled “Salesforce Monthly Incidents Prediction,” showing predicted and actual ticket creation counts from 2018 to early 2023, with a three-month forward forecast and confidence bands.

    Experiments are always stored under the user’s namespace, which means that changing sharing settings and permissions on experiments is not supported.

    Now you know how to create and run a prediction model with Splunk MLTK. Let us know if your model works, and if you have any questions after running your next prediction. Happy Splunking!

  • Splunk Timestamp Extraction – Where and How to Find Time!

    Splunk Timestamp Extraction – Where and How to Find Time!

    By Tyler Phillips, Splunk Consultant

    Splunk timestamp extraction can be tricky until you work with it a couple times. Follow along with me through a couple different examples and you should be able to extract a timestamp out of any data. 

    So, what do we use to extract a time stamp? There are a few settings in Splunk’s “Magic 8” that go into props.conf of the data you are trying to ingest. There are three settings were going to work with today.

    TIME_PREFIX

    TIME_PREFIX is the regex to tell Splunk where to start looking for the timestamp. Splunk will then attempt to make a timestamp out of the characters that follow the prefix. If the prefix cannot be found then timestamp extraction will not occur.

    MAX_TIMESTAMP_LOOKAHEAD

    This is the count of characters you want to look at in the timestamp. This count begins right after the end of the found TIME_PREFIX characters and counts from there. This does not count from the start of the event.

    TIME_FORMAT

    Time variables used to parse out our timestamp and tell Splunk what each item is.

    VariableDescription
    %EzSplunk-specific, timezone in minutes.
    %HHour (24-hour clock) as a decimal number. Hours are represented by the values 00 to 23. Leading zeros are accepted but not required.
    %IUppercase “i”. Hour (12-hour clock) with the hours represented by the values 01 to 12. Leading zeros are accepted but not required. Use with %p to specify AM or PM for the 12-hour clock.
    %MMinute as a decimal number. Minutes are represented by the values 00 to 59. Leading zeros are accepted but not required.
    %NThe number of subsecond digits. The default is %9N. You can specify %3N = milliseconds, %6N = microseconds, %9N = nanoseconds.
    %pAM or PM.
    %TThe time in 24-hour notation (%H:%M:%S). For example 23:59:59.
    %XThe time in the format for the current locale. For US English the format for 9:30 AM is 9:30:00.
    %ZThe timezone abbreviation. For example EST for US Eastern Standard Time.

    So, for testing we are going to use my local Splunk install and the add data wizard/upload data to test our configs and check the data.

    My first example is the splunkd_ui_accesslogs in my internal index. This one is pretty simple as Splunk actually already picks up the timestamp for us! That’s it right? Well, we could stop there and let Splunk do the work or we could tell Splunk exactly where to look and what to look at so it doesn’t have to waste resources trying to do this itself.

    Splunk's "Set Source Type" page showing basic line merge and line breaker settings without timestamp extraction configured.

    As you can see the correct timestamp is highlighted and yet we don’t have any settings set in advanced. Let’s change that.

    First were going to take this event into a regex tester (I use regex101) to create a regex for before the timestamp. Doing this I was able to use “s[“ as my TIME_PREFIX.

    TIME_PREFIX = s[

    Next, I counted the number of characters in the timestamp and came up with 30 characters including the space. Yes, the space does count.

    MAX_TIMESTAMP_LOOKAHEAD = 30

    Now for the fun part. We are going to use the Splunk Time Variables doc to create a TIME_FORMAT. 

    Using this page, we want to find the correct variable for each element of the time and write it out in the same format with those variables. Here is what I came up with for this timestamp.

    TIME_FORMAT = %d/%b/%Y:%H:%M:%S.%3N %z

    The %z at the end represents time zone in the data.

    Splunk source type configuration with advanced timestamp fields filled in, including TIME_PREFIX and TIME_FORMAT.

    Using these settings, we can see that our test worked and we are collecting the correct timestamp for Splunk so it can save on workload.

    Next, I am going to use a splunkd.log event.

    11-07-2023 12:09:09.683 -0500 INFO TailReader [1039908 tailreader0] – Batch input finished reading file=’/Applications/Splunk/var/spool/splunk/tracker.log’

    This event has the timestamp at the beginning of the event so we are going to use the TIME_PREFIX of “^”. This tells Splunk that the timestamp is at the very beginning of the event. The methods for creating the MAX_TIMESTAMP_LOOKAHEAD and TIME_FORMAT stay the same. Using this event, I came up with these settings.

    TIME_PREFIX = ^

    MAX_TIMESTAMP_LOOKAHEAD = 29

    TIME_PREFIX = %m-%d-%Y %H:%M:%S.%3N %z

    Splunk timestamp extraction example showing correctly parsed log events with yellow-highlighted timestamps and INFO-level log entries.

    Next, I did want to show some syslog data and working with its timestamps. Nothing different here but syslog is a very common type of data so I thought it would be good to include. Here I will be using a couple of F5 syslog events. My settings are:

    TIME_PREFIX = ^

    MAX_TIMESTAMP_LOOKAHEAD = 15

    TIME_FORMAT = %b %d %H:%M:%S

    Splunk input settings for source type F5_Example with mixed timestamp formats visible across multiple log types.

    If you are looking to work well with timestamps it may take a couple tries and some practice but it will be easy to pick up and make things smoother for you when bringing in data. I am happy to answer any questions you have, just contact me using the form below. Happy Splunking!

  • Useful Online Resources for the Aspiring Splunk Admin

    Useful Online Resources for the Aspiring Splunk Admin

    By Eric Levy, Splunk Consultant

    No matter how much training you go through and how many certifications you get, you can truly never know everything about Splunk. Some of it isn’t even provided in training itself – to properly use Splunk, you’ll need experience around the command line, data sources, and syslog. Even beyond that, you’ll never truly memorize every possible setting in props.conf or how to form every possible regular expression.

    Here is a list of resources that my fellow TekStream colleagues and I compiled that we use on a near daily basis to assist in our Splunk work.

    OFFICIAL SPLUNK RESOURCES 

    Splunk Docs

    You will never go a day using Splunk without referring to the official documentation, colloquially known as the “Docs”. It has pages on every product offered by Splunk, including premium apps and select supported apps in Splunkbase, and provides detailed installation steps, configuration steps, upgrade steps, and best practices. Nearly every .conf file and SPL command/function has its own page for reference, on top of formatting standards for time values and dashboards (both Classic and Studio). The added benefit is that Splunk keeps previous versions of the Docs available if you aren’t running on the latest version. While the Docs are an essential resource, be wary of vague wording on some pages.

    Splunk Community Posts

    If you didn’t find it in the Docs, somebody else didn’t either. The Splunk community has thousands of Q&A threads for tricky searches, error messages, unconventional log sources, and other specific use cases. Oftentimes community posts and the docs go hand in hand as several users link back to the docs for more information on an answer. It’s sites like here that show how limitless the sky can be with Splunk.

    Splunkbase

    A repository for apps to install in Splunk – some supported, others not. Includes technical add-ons (TAs) for data sources, front-facing apps with useful dashboards, alerts, and searches, and even custom visualizations (like a calendar, for example). While you’ll always interact with Splunkbase in some way or another (as Splunk communicates with it directly to install apps), the site itself is useful for documentation and important updates provided by the developers. Don’t see an app for your purposes? Develop one and submit it for others to use!

    ENTERPRISE SECURITY

    Splunk ES Detections

    This constantly updated list provided by Splunk has several threat detections to use in Enterprise Security. Each detection has steps for implementation, security context, and known false positives. Keep in mind that some are marked “experimental” and may not be confirmed as effective.

    Risk Based Alerting Guide

    Risk Based Alerting is a powerful and unique feature in Enterprise Security for prioritizing threat sources, and this free PDF is a guide for how to use it and get the most value out of your security notables.

    UNOFFICIAL SPLUNK RESOURCES

    Splunk Subreddit

    Unaffiliated with Splunk, but the subreddit is a sufficient alternative to the Splunk Community posts when searching for an unconventional use case.

    Stack Overflow

    Similar to the Splunk Community posts and the subreddit, here is another great resource to find unconventional use cases.

    GoSplunk 

    An open repository for SPL queries and dashboards, essential for anyone getting started with SPL and/or looking for inspiration for their own projects. They also have a blog with some helpful Splunk information, although they haven’t been updated in over 5 years.

    TekStream Splunk Blog Posts 

    Our esteemed Splunk Consultants from all over the country always post helpful information, tips, and resources to this very blog. Be sure to follow us on LinkedIn for updates and new blogs as they come in!

    NON-SPLUNK ESSENTIALS 

    RegexOne 

    A perfect starting ground for learning regular expressions.

    Regex101 

    Once you’ve mastered RegexOne, Regex101 becomes an invaluable tool for figuring out regular expressions for field extractions and line breaking. Don’t be surprised if you use this website every week, if not every day.

    JSON Formatter 

    Helpful for developing apps and deciphering complicated log files (although Splunk is generally quite good displaying these events via INDEXED_EXTRACTIONS or KV_MODE).

    Crontab Guru 

    Some reports and alerts may need to be run on an unconventional interval for their own reasons or for spreading out search jobs. Splunk uses cron jobs to set up such alerting and this site makes formatting them easy. Just copy and paste directly into Splunk when finished.

    Character Count Tool 

    MAX_TIMESTAMP_LOOKAHEAD and TRUNCATE are essential props.conf settings to help Splunk parse time and guide each sourcetype on event length. Instead of manually counting characters, paste an event or a timestamp here to get a value immediately.

    Epoch Time Converter 

    I’ve developed use cases for my own customers to filter dashboard panels based on time intervals, which involve weaving around values set by the time picker with directly comparing epoch values. Other times, I may want to verify that the timestamps coming in are being read correctly by Splunk into the right time zone offset. This converter is perfect for translating dates to and from epoch time for these use cases and beyond.

    This list is in no way comprehensive – there are infinite use cases for Splunk that may require other tools. These are just the ones that me and my fellow consultants at TekStream use regularly. Happy Splunking!