<?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: Why some of the field values are missing after stats and chart  command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347434#M102893</link>
    <description>&lt;P&gt;Can you try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval eventHour=strftime(_time,"%H") 
 | table eventHour STORAGECYCLEGROUPID DESTINATIONRACKLOCATION AISLE BAY LEVEL 
 | sort STORAGECYCLEGROUPID EVENTTS ASC 
 | autoregress STORAGECYCLEGROUPID as SC 
 | eval SC2=(STORAGECYCLEGROUPID-SC) 
 | eval cyclecheck=if(SC2=="0",0,1) 
 | autoregress BAY as BAY2 
 | eval baycheck=abs(BAY-BAY2) 
 | autoregress LEVEL as LEVEL2 
 | eval levelcheck=abs(LEVEL-LEVEL2) 
 | eval stops=if(cyclecheck=1 OR baycheck&amp;gt;1 OR levelcheck&amp;gt;0,1,0) 
 | stats  sum(stops) as numberofstop by STORAGECYCLEGROUPID , eventHour
 | chart count over eventHour by numberofstop 
 | rename 1 as "1 Stop", 2 as "2 Stops", 3 as "3 Stops", 4 as "4 Stops"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Apr 2018 04:02:49 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2018-04-18T04:02:49Z</dc:date>
    <item>
      <title>Why some of the field values are missing after stats and chart  command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347433#M102892</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;When I run the below query, it only returns the eventHour up to 14 (2pm) when there are events up to eventHour 18 (6pm).&lt;BR /&gt;
I tried to add |search eventHour=15,16,17,18 after the |eval eventHour and it returned the stats on those eventHours.&lt;/P&gt;

&lt;P&gt;What should I do to display the stats on all eventHours? Thank you!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;---search---

| eval eventHour=strftime(_time,"%H") 
| table eventHour STORAGECYCLEGROUPID DESTINATIONRACKLOCATION AISLE BAY LEVEL 
| sort STORAGECYCLEGROUPID EVENTTS ASC 
| autoregress STORAGECYCLEGROUPID as SC 
| eval SC2=(STORAGECYCLEGROUPID-SC) 
| eval cyclecheck=if(SC2=="0",0,1) 
| autoregress BAY as BAY2 
| eval baycheck=abs(BAY-BAY2) 
| autoregress LEVEL as LEVEL2 
| eval levelcheck=abs(LEVEL-LEVEL2) 
| eval stops=if(cyclecheck=1 OR baycheck&amp;gt;1 OR levelcheck&amp;gt;0,1,0) 
| stats max(eventHour) as eventHour sum(stops) as numberofstop by STORAGECYCLEGROUPID 
| chart count over eventHour by numberofstop 
| rename 1 as "1 Stop", 2 as "2 Stops", 3 as "3 Stops", 4 as "4 Stops"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 03:51:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347433#M102892</guid>
      <dc:creator>auaave</dc:creator>
      <dc:date>2018-04-18T03:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why some of the field values are missing after stats and chart  command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347434#M102893</link>
      <description>&lt;P&gt;Can you try :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval eventHour=strftime(_time,"%H") 
 | table eventHour STORAGECYCLEGROUPID DESTINATIONRACKLOCATION AISLE BAY LEVEL 
 | sort STORAGECYCLEGROUPID EVENTTS ASC 
 | autoregress STORAGECYCLEGROUPID as SC 
 | eval SC2=(STORAGECYCLEGROUPID-SC) 
 | eval cyclecheck=if(SC2=="0",0,1) 
 | autoregress BAY as BAY2 
 | eval baycheck=abs(BAY-BAY2) 
 | autoregress LEVEL as LEVEL2 
 | eval levelcheck=abs(LEVEL-LEVEL2) 
 | eval stops=if(cyclecheck=1 OR baycheck&amp;gt;1 OR levelcheck&amp;gt;0,1,0) 
 | stats  sum(stops) as numberofstop by STORAGECYCLEGROUPID , eventHour
 | chart count over eventHour by numberofstop 
 | rename 1 as "1 Stop", 2 as "2 Stops", 3 as "3 Stops", 4 as "4 Stops"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 04:02:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347434#M102893</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-04-18T04:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why some of the field values are missing after stats and chart  command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347435#M102894</link>
      <description>&lt;P&gt;@p_gurav, thanks for your reply! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I tried it but it's still the same. Btw, I am using |stats max(eventHour) because 1 STORAGECYCLEGROUPID can have maximum of 4 events and I want it to look at the max eventHour if incase all events did not occur on the same eventHour.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 04:11:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-some-of-the-field-values-are-missing-after-stats-and-chart/m-p/347435#M102894</guid>
      <dc:creator>auaave</dc:creator>
      <dc:date>2018-04-18T04:11:38Z</dc:date>
    </item>
  </channel>
</rss>

