<?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 to check if values are incremental by 1 for a specific category in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519031#M146146</link>
    <description>&lt;P&gt;It's possible to find before applying stats. after applying stats may be possible but it's not easy.&lt;/P&gt;&lt;P&gt;can you also confirm, if those values are in sequential with timestamp?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2020 09:16:16 GMT</pubDate>
    <dc:creator>thambisetty</dc:creator>
    <dc:date>2020-09-11T09:16:16Z</dc:date>
    <item>
      <title>How to check if values are incremental by 1 for a specific category</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519018#M146140</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nikitha_0-1599812489183.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10770i3B345D543D8F0E66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nikitha_0-1599812489183.png" alt="Nikitha_0-1599812489183.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If the above displayed data is the result for my stats command [&lt;STRONG&gt;stats values(Values) as Values by Category&lt;/STRONG&gt;], how can I use the search to check if the values for each category are incremental by 1 and output the values that have been missed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;I want the result to look like this :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nikitha_1-1599812726846.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10772i65CD2A3072E1990B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nikitha_1-1599812726846.png" alt="Nikitha_1-1599812726846.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 08:28:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519018#M146140</guid>
      <dc:creator>Nikitha</dc:creator>
      <dc:date>2020-09-11T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if values are incremental by 1 for a specific category</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519028#M146145</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults | eval event="{\"Category\":\"Cat1\",\"Values\":[1,2,3,5,7]}\n{\"Category\":\"Cat2\",\"Values\":[6,8,9,10]}"
| eval event=split(event,"\n")
| mvexpand event
| spath input=event
| rename Values{} as Values
| fields Category, Values
| fields - _time
| eval low=tonumber(mvindex(Values,0))
| eval high=tonumber(mvindex(Values,mvcount(Values)-1))
| eval expected=mvrange(low, high + 1)
| eval missing=mvmap(expected,if(isnull(mvfind(Values,expected)),expected,NULL()))
| fields Category, missing
| rename missing as Values&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 11 Sep 2020 09:08:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519028#M146145</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-11T09:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if values are incremental by 1 for a specific category</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519031#M146146</link>
      <description>&lt;P&gt;It's possible to find before applying stats. after applying stats may be possible but it's not easy.&lt;/P&gt;&lt;P&gt;can you also confirm, if those values are in sequential with timestamp?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 09:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519031#M146146</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-11T09:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if values are incremental by 1 for a specific category</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519033#M146147</link>
      <description>&lt;P&gt;try below:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats max(value) as max_value min(value) as min_value values(value) as values by Category
| eval all_numbers=mvrange(min_value,max_value+1)
| fields - max_value,min_value
| nomv values
| eval values=replace(values,"\s",",")
| mvexpand all_numbers
| eval is_found=if(match(values,all_numbers),1,0)
| search is_found=0
| stats values(all_numbers) as missing_values by Category&lt;/LI-CODE&gt;&lt;P&gt;reference:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-find-the-missing-number-sequence-from-a-table/m-p/433590" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-find-the-missing-number-sequence-from-a-table/m-p/433590&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 09:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/519033#M146147</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-11T09:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if values are incremental by 1 for a specific category</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/656964#M226915</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you able to explain each line usage if possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we build this same missing_number logic in if condition and throw an error if we miss any number in between.&lt;BR /&gt;&lt;BR /&gt;In our case also the sequnce increase by one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each Doc_ID(AGDGYS8737vdhh = file_name like category mentioned in this post) has set of sequence_number increase one by one.If it not increase by one means then we came to conclusion like some number missed in between we can trigger alert then and there.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 14:10:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-check-if-values-are-incremental-by-1-for-a-specific/m-p/656964#M226915</guid>
      <dc:creator>Naga2</dc:creator>
      <dc:date>2023-09-07T14:10:08Z</dc:date>
    </item>
  </channel>
</rss>

