<?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: How can gaps be detected in data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400206#M170976</link>
    <description>&lt;P&gt;oh yeah haha, like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=ssys_*_pj 
     | delta _time p=1 | rename delta(_time) AS timeDeltaS
     | `SerialNumber`
     | stats last(timeDeltaS) as timeDeltaS by  SerialNumber
     | where timeDeltaS &amp;gt; 14400
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Are you working on the source field only ?&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2019 13:03:14 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-30T13:03:14Z</dc:date>
    <item>
      <title>How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400194#M170964</link>
      <description>&lt;P&gt;Hello, is there a way to detect gaps in data by some id? &lt;BR /&gt;
As well as check if the gap is greater than 4 hours, then show the last event and the one before him?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 06:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400194#M170964</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T06:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400195#M170965</link>
      <description>&lt;P&gt;i will give an example&lt;/P&gt;

&lt;P&gt;i have logs from 07/05/19 15:23:57 for some SerialNumber&lt;BR /&gt;
and the next time i have log is 08/05/19 09:19:02&lt;BR /&gt;
i want to catch such stuff&lt;BR /&gt;
is it possible ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 10:08:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400195#M170965</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T10:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400196#M170966</link>
      <description>&lt;P&gt;Hi @sarit_s,&lt;/P&gt;

&lt;P&gt;Yes you can !&lt;/P&gt;

&lt;P&gt;Here's an easy command that you can apply on your data with 900 sec gap:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | streamstats current=f last(_time) as last_time by host | eval gap = last_time - _time | where gap &amp;gt; 900 | convert ctime(last_time) as last_time | table _time last_time host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;from here :&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/69728/search-to-find-gaps-in-data.html"&gt;https://answers.splunk.com/answers/69728/search-to-find-gaps-in-data.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 10:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400196#M170966</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-30T10:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400197#M170967</link>
      <description>&lt;P&gt;Hi David,&lt;BR /&gt;
thanks !&lt;BR /&gt;
i saw this post but i have some issues with it:&lt;/P&gt;

&lt;P&gt;what is 900? 900 seconds ?&lt;BR /&gt;
also, i want to see the relevant events &lt;BR /&gt;
so, if taking my last example:&lt;BR /&gt;
then i want to the see the event from 07/05/19 15:23:57&lt;BR /&gt;
and the event from 08/05/19 09:19:02&lt;/P&gt;

&lt;P&gt;third thing is that this query running for very long time&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 10:45:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400197#M170967</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T10:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400198#M170968</link>
      <description>&lt;P&gt;yeah 900 seconds, since time is in epoch, subtracting now and latest will be in seconds. &lt;/P&gt;

&lt;P&gt;Give me your original query and ill give you the right part to add to it for time gap. &lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 10:48:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400198#M170968</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-30T10:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400199#M170969</link>
      <description>&lt;P&gt;thanks !&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ssys_*_pj 
| `SerialNumber`
| streamstats current=f last(_time) as last_time by SerialNumber
| eval gap = last_time - _time
| where gap &amp;gt; 14400 
| convert ctime(last_time) as last_time
| table _time last_time SerialNumber
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2019 10:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400199#M170969</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T10:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400200#M170970</link>
      <description>&lt;P&gt;try this, itll give u the gap between the last time u saw the serialnumber and the time u ran the search :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ssys_*_pj 
 | `SerialNumber`
 | stats last(_time) as last_time by  SerialNumber
 | addinfo
 | eval gap = last_time -  info_search_time
 | where gap &amp;gt; 14400 
 | convert ctime(last_time) as last_time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2019 11:34:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400200#M170970</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-30T11:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400201#M170971</link>
      <description>&lt;P&gt;Thanks David&lt;BR /&gt;
but it is also very very slow&lt;/P&gt;

&lt;P&gt;also, i think that the last time i saw the SerialNumber won't give the right results since the gap can be 7 days ago and i saw the SerialNumber today also&lt;/P&gt;

&lt;P&gt;and the gap should not be related to the time i run the search, but the different time between two events of one Serialnumber&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 11:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400201#M170971</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T11:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400202#M170972</link>
      <description>&lt;P&gt;can you share what's in the macro please ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 11:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400202#M170972</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-30T11:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400203#M170973</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;eval SerialNumber = mvindex(split(source,"/") ,7)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2019 11:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400203#M170973</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T11:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400204#M170974</link>
      <description>&lt;P&gt;okay, lets give &lt;CODE&gt;delta&lt;/CODE&gt; a try then, could be faster : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=ssys_*_pj 
    | delta _time p=1 | rename delta(_time) AS timeDeltaS
    | stats last(timeDeltaS) as timeDeltaS by  SerialNumber
    | where timeDeltaS &amp;gt; 14400
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2019 12:28:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400204#M170974</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-30T12:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400205#M170975</link>
      <description>&lt;P&gt;it is also very slow&lt;/P&gt;

&lt;P&gt;also, can it be in a table where i will see SerialNumber and the relevant events ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 12:35:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400205#M170975</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T12:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400206#M170976</link>
      <description>&lt;P&gt;oh yeah haha, like this : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=ssys_*_pj 
     | delta _time p=1 | rename delta(_time) AS timeDeltaS
     | `SerialNumber`
     | stats last(timeDeltaS) as timeDeltaS by  SerialNumber
     | where timeDeltaS &amp;gt; 14400
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Are you working on the source field only ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 13:03:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400206#M170976</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-30T13:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400207#M170977</link>
      <description>&lt;P&gt;it is also very slow &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;im working only on the SerialNumber field which im taking from the source&lt;BR /&gt;
and also _time field &lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 16:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400207#M170977</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-05-30T16:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400208#M170978</link>
      <description>&lt;P&gt;hey @DavidHourani &lt;BR /&gt;
do you have any idea ?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 05:49:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400208#M170978</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-06-05T05:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400209#M170979</link>
      <description>&lt;P&gt;Hey @sarit_s,&lt;/P&gt;

&lt;P&gt;I was thinking maybe move the where clause to the beginning of the query like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ssys_*_pj 
      | delta _time p=1 | rename delta(_time) AS timeDeltaS
| where timeDeltaS &amp;gt; 14400
| `SerialNumber`
 | stats last(timeDeltaS) as timeDeltaS by  SerialNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if that's faster for u&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 07:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400209#M170979</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-05T07:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400210#M170980</link>
      <description>&lt;P&gt;unfortunately no &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;i found that the first option :&lt;BR /&gt;
     index=ssys_*_pj &lt;BR /&gt;
     | &lt;CODE&gt;SerialNumber&lt;/CODE&gt;&lt;BR /&gt;
     | streamstats current=f last(_time) as last_time by SerialNumber&lt;BR /&gt;
     | eval gap = last_time - _time&lt;BR /&gt;
     | where gap &amp;gt; 14400 &lt;BR /&gt;
     | convert ctime(last_time) as last_time&lt;BR /&gt;
     | table _time last_time SerialNumber&lt;/P&gt;

&lt;P&gt;its the fastest between them all , maybe we can find a way to improve it so it will be a little bit faster&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400210#M170980</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2020-09-30T00:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400211#M170981</link>
      <description>&lt;P&gt;Okay, try this then based on a mix of all searches so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ssys_*_pj 
| dedup 2 source
| eval SerialNumber = mvindex(split(source,"/") ,7) 
| streamstats current=f last(_time) as last_time by SerialNumber
| eval timeDeltaS = last_time - _time
| stats last(timeDeltaS) as timeDeltaS by  SerialNumber
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jun 2019 08:27:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400211#M170981</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-05T08:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400212#M170982</link>
      <description>&lt;P&gt;Just modified the previous comment, have a look &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; over how much time is this search running ?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 08:36:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400212#M170982</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-05T08:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can gaps be detected in data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400213#M170983</link>
      <description>&lt;P&gt;well.. more than 6 minutes later and it is still running with no result &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 08:46:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-gaps-be-detected-in-data/m-p/400213#M170983</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-06-05T08:46:45Z</dc:date>
    </item>
  </channel>
</rss>

