<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk Query To Evaluate Absence Of A Signature In the Logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688503#M234728</link>
    <description>&lt;P&gt;Beautiful.&lt;BR /&gt;&lt;BR /&gt;Many thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2024 17:40:08 GMT</pubDate>
    <dc:creator>victorcorrea</dc:creator>
    <dc:date>2024-05-23T17:40:08Z</dc:date>
    <item>
      <title>Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688484#M234718</link>
      <description>&lt;P&gt;Hi Splunk Community,&lt;BR /&gt;&lt;BR /&gt;I need to build an alert that will be triggered if a specific signature is not present in the logs for a period of time.&lt;BR /&gt;&lt;BR /&gt;The message shows up in the logs every 3 or 4 seconds in BAU conditions, but there are some instances of longer intervals going up to 4 minutes.&lt;BR /&gt;&lt;BR /&gt;What I had in mind was a query that ran over a 15-time timeframe using 5-minute buckets - to ensure that I would catch the negative trend and not only the one offs.&lt;BR /&gt;&lt;BR /&gt;I have made it this far in the query:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;index=its-em-pbus3-app "Checking the receive queue for a message of size"
| bin _time span=5m aligntime=@m
| eval day_of_week = strftime(_time,"%A")
| where NOT (day_of_week="Saturday" OR day_of_week="Sunday")
| eval date_hour = strftime(_time, "%H") 
| where (date_hour &amp;gt; 7 AND date_hour &amp;lt; 19)
| stats count by _time &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;**&lt;EM&gt;I only need the results for Monday to Friday between the hours of 7AM and 7PM.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The query returns the count by _time, which is great, but if the signature is not present I don't get any hits, obviously.&lt;BR /&gt;&lt;BR /&gt;So I can count the number of occurrences within the 5-minute buckets, but I can't assess the intervals or determine the absence using count.&lt;BR /&gt;&lt;BR /&gt;I thought of, perhaps, manipulating timestamps so I could calculate the difference between current time and the last timestamp of the event, but I am not exactly sure how to compare a timestamp to "now".&lt;BR /&gt;&lt;BR /&gt;I would appreciate if I could get some advice on either how to count "nulls" or how to cross-reference the timestamps of the signature against current time.&lt;BR /&gt;&lt;BR /&gt;Thank you all in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 15:07:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688484#M234718</guid>
      <dc:creator>victorcorrea</dc:creator>
      <dc:date>2024-05-23T15:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688486#M234720</link>
      <description>&lt;P&gt;The timechart command will fill in the missing timeslots for you&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where (date_hour &amp;gt;= 7 AND date_hour &amp;lt; 19)
| timechart span=5m count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;(btw, you probably want &amp;gt;= 7 if you want from 7am)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 15:27:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688486#M234720</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-05-23T15:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688491#M234721</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Thanks for reply and catching the issue with the date_hour operator. You're absolutely right as I do want to include 7AM.&lt;BR /&gt;&lt;BR /&gt;I tried using timechart instead of stats in the query and selected a timeframe during which I know for a fact that there are no occurrences of the event containing the signature.&lt;BR /&gt;&lt;BR /&gt;I was expecting to see a count of 0 but instead I got no results:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="victorcorrea_0-1716479352501.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30947i7D029CB721CDB5F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="victorcorrea_0-1716479352501.png" alt="victorcorrea_0-1716479352501.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried adding &lt;STRONG&gt;fillnull&amp;nbsp;&lt;/STRONG&gt;to the bottom of the query as I thought that, maybe, the count was returning null instead of "0" to no avail.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 15:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688491#M234721</guid>
      <dc:creator>victorcorrea</dc:creator>
      <dc:date>2024-05-23T15:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688499#M234725</link>
      <description>&lt;P&gt;You need at least 1 result during the period to get the results filled in. If there are no results, you could try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| appendpipe
    [| stats count as _count
    | where _count=0
    | addinfo
    | rename info_min_time as _time 
    | eval count=0
    | fields _time count]
| timechart sum(count) as count
| eval count=coalesce(count,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 May 2024 17:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688499#M234725</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-05-23T17:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688500#M234726</link>
      <description>&lt;P&gt;Many thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;That did the trick beautifully. The only bit I didn't quite understand in the query was the renaming the info_min_time as _time, I'll accept the comment as solution, but if you'd be so kind to shed some light on what that line is doing it would be wonderful.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Victor&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 17:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688500#M234726</guid>
      <dc:creator>victorcorrea</dc:creator>
      <dc:date>2024-05-23T17:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688502#M234727</link>
      <description>&lt;P&gt;If the _count is zero, there are no events, so the addinfo and rename is setting a value for the _time field for the event being added by append pipe to be the start time of the search period. This is so that the subsequent timechart command has at least one event with a _time value in the search period. With that one event, the timechart command will then fill in the missing time slots.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 17:37:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688502#M234727</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-05-23T17:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query To Evaluate Absence Of A Signature In the Logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688503#M234728</link>
      <description>&lt;P&gt;Beautiful.&lt;BR /&gt;&lt;BR /&gt;Many thanks,&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2024 17:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-To-Evaluate-Absence-Of-A-Signature-In-the-Logs/m-p/688503#M234728</guid>
      <dc:creator>victorcorrea</dc:creator>
      <dc:date>2024-05-23T17:40:08Z</dc:date>
    </item>
  </channel>
</rss>

