<?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: Group by repeating value at value change in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504559#M140900</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;thanks kamlesh. thats what i was looking at. Just to add to that, if i need to get a max and min value of a field in this grouping say "fan_speed" or "cpu_load" values which i have, where would i add those evaluations ?&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 07:54:46 GMT</pubDate>
    <dc:creator>aseadmin</dc:creator>
    <dc:date>2020-06-16T07:54:46Z</dc:date>
    <item>
      <title>Group by repeating value at value change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504546#M140896</link>
      <description>&lt;P&gt;Hi, I require a little help here as i having spent a lot of time researching for a solution without any luck&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a vehicle idling data where the data is like below,&lt;/P&gt;&lt;P&gt;MACHINE&amp;nbsp; &amp;nbsp; STATUS&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can i get a consolidated view from the above data in below consolidated way ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MACHINE&amp;nbsp; &amp;nbsp; STATUS&amp;nbsp; &amp;nbsp; COUNT&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted the data in the above way, so that i know for long the machine was idling at various part of time rather than how long the machine was idling during a filtered time&lt;/P&gt;&lt;P&gt;any help will be much appreciated.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 06:46:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504546#M140896</guid>
      <dc:creator>aseadmin</dc:creator>
      <dc:date>2020-06-16T06:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Group by repeating value at value change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504554#M140897</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/185227"&gt;@aseadmin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;YOUR_SEARCH | eval a=1| accum a
| streamstats window=2 first(STATUS) as F last(STATUS) as L | eval b=if(F!=L,a,null()) | filldown b |fillnull value=0 b | stats count by b,STATUS | table STATUS count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Search:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| makeresults 
| eval _raw="MACHINE    STATUS

A                      1

A                      1

A                      1

A                      0

A                      0

A                      1

A                      1" 
| multikv 
| table MACHINE STATUS | eval a=1| accum a
| streamstats window=2 first(STATUS) as F last(STATUS) as L | eval b=if(F!=L,a,null()) | filldown b |fillnull value=0 b | stats count by b,STATUS | table STATUS count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 07:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504554#M140897</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-06-16T07:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Group by repeating value at value change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504557#M140899</link>
      <description>&lt;P&gt;This will give you the exact result from your example, but I am pretty sure it's an inelegant solution that can be improved on...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval data="A:1,A:1,A:1,A:0,A:0,A:1,A:1"
| makemv delim="," data
| mvexpand data
| rex field=data "(?&amp;lt;machine&amp;gt;\w):(?&amp;lt;status&amp;gt;\w)"
| fields - data
| streamstats reset_on_change=t c by machine status
| reverse
| streamstats reset_on_change=t max(c) as count by machine status
| where c=count
| reverse
| table machine status count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 07:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504557#M140899</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-06-16T07:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Group by repeating value at value change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504559#M140900</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;thanks kamlesh. thats what i was looking at. Just to add to that, if i need to get a max and min value of a field in this grouping say "fan_speed" or "cpu_load" values which i have, where would i add those evaluations ?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 07:54:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504559#M140900</guid>
      <dc:creator>aseadmin</dc:creator>
      <dc:date>2020-06-16T07:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Group by repeating value at value change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504566#M140902</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/185227"&gt;@aseadmin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you pleas share some sample event or table same like you shared in question ? So we can help you on&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 09:23:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504566#M140902</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-06-16T09:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Group by repeating value at value change</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504599#M140913</link>
      <description>&lt;P&gt;No worries, i found a way out extending from your query. The query you shared was what i required to start with (a solution i didn't find anywhere). Thanks once again.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 12:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-by-repeating-value-at-value-change/m-p/504599#M140913</guid>
      <dc:creator>aseadmin</dc:creator>
      <dc:date>2020-06-16T12:32:14Z</dc:date>
    </item>
  </channel>
</rss>

