<?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: When the value is not showed in the result also i need to dispaly value as 0 in the result set .. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440113#M125155</link>
    <description>&lt;P&gt;@shankarananth &lt;/P&gt;

&lt;P&gt;Is ASSIGNED values is fixed? ( &lt;CODE&gt;ASSIGNED IN ("Cool","Super","Thunder","Lightray","Bluesky")&lt;/CODE&gt; ).&lt;/P&gt;

&lt;P&gt;Can you please try following search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;indexXXXX ASSIGNED IN ("Cool","Super","Thunder","Lightray","Bluesky") 
| eval newfield=now() 
| eval Openeddates=strptime(Openeddate, "%Y-%m-%d %H:%M:%S") 
| eval todate= strftime(strptime(Openeddate,"%Y-%m-%d %H:%M:%S"),"%Y-%m-%d %H:%M:%S") 
| eval todate1= strftime(newfield,"%Y-%m-%d %H:%M:%S") 
| eval TimeDiff1=strptime(todate1,"%Y-%m-%d %H:%M:%S")-strptime(todate,"%Y-%m-%d %H:%M:%S") 
| eval sectodate=round(TimeDiff1/60/60/24,0) 
| where sectodate&amp;gt;5 
| stats count as Usage by ASSIGNED 
| append 
    [| makeresults 
    | eval mySelectedValue="Cool,Super,Thunder,Lightray,Bluesky", ASSIGNED =split(mySelectedValue,",") 
    | mvexpand ASSIGNED 
    | eval count=0 
    | table ASSIGNED count] | stats sum(count) as Count by ASSIGNED
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 Jun 2018 13:25:18 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2018-06-07T13:25:18Z</dc:date>
    <item>
      <title>When the value is not showed in the result also i need to dispaly value as 0 in the result set ..</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440111#M125153</link>
      <description>&lt;P&gt;In the below query. When i filter the sectodate count greater than 5. I’m missing the count of values “Cool","Super . That’s is really fine as they doesn’t satisfies the where clause condition so data is not displaying in table. But Still I need to display both Cool and Super usage as 0 in the table is it possible.. Please help me on it. Thanks in advance..&lt;/P&gt;

&lt;P&gt;indexXXXX    ASSIGNED IN ("Cool","Super","Thunder","Lightray","Bluesky")&lt;BR /&gt;&lt;BR /&gt;
| eval newfield=now() &lt;BR /&gt;
|eval Openeddates=strptime(Openeddate, "%Y-%m-%d %H:%M:%S") &lt;BR /&gt;
| eval todate= strftime(strptime(Openeddate,"%Y-%m-%d %H:%M:%S"),"%Y-%m-%d %H:%M:%S")&lt;BR /&gt;
| eval todate1= strftime(newfield,"%Y-%m-%d %H:%M:%S")&lt;BR /&gt;
| eval TimeDiff1=strptime(todate1,"%Y-%m-%d %H:%M:%S")-strptime(todate,"%Y-%m-%d %H:%M:%S")&lt;BR /&gt;
| eval sectodate=round(TimeDiff1/60/60/24,0)&lt;BR /&gt;
| where sectodate&amp;gt;5&lt;BR /&gt;
| stats count as Usage by ASSIGNED&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5137i661C23805B74F18B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks in Advance .. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 12:37:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440111#M125153</guid>
      <dc:creator>Shan</dc:creator>
      <dc:date>2018-06-07T12:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: When the value is not showed in the result also i need to dispaly value as 0 in the result set ..</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440112#M125154</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(your search)
| eval sectodate=round(TimeDiff1/60/60/24,0)
| where sectodate&amp;gt;5
| stats count as Usage by ASSIGNED
↓
(your search)
| eval sectodate=round(TimeDiff1/60/60/24,0)
| stats count(eval(if(sectodate&amp;gt;5,1,0))) as Usage by ASSIGNED
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440112#M125154</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-06-07T13:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: When the value is not showed in the result also i need to dispaly value as 0 in the result set ..</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440113#M125155</link>
      <description>&lt;P&gt;@shankarananth &lt;/P&gt;

&lt;P&gt;Is ASSIGNED values is fixed? ( &lt;CODE&gt;ASSIGNED IN ("Cool","Super","Thunder","Lightray","Bluesky")&lt;/CODE&gt; ).&lt;/P&gt;

&lt;P&gt;Can you please try following search?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;indexXXXX ASSIGNED IN ("Cool","Super","Thunder","Lightray","Bluesky") 
| eval newfield=now() 
| eval Openeddates=strptime(Openeddate, "%Y-%m-%d %H:%M:%S") 
| eval todate= strftime(strptime(Openeddate,"%Y-%m-%d %H:%M:%S"),"%Y-%m-%d %H:%M:%S") 
| eval todate1= strftime(newfield,"%Y-%m-%d %H:%M:%S") 
| eval TimeDiff1=strptime(todate1,"%Y-%m-%d %H:%M:%S")-strptime(todate,"%Y-%m-%d %H:%M:%S") 
| eval sectodate=round(TimeDiff1/60/60/24,0) 
| where sectodate&amp;gt;5 
| stats count as Usage by ASSIGNED 
| append 
    [| makeresults 
    | eval mySelectedValue="Cool,Super,Thunder,Lightray,Bluesky", ASSIGNED =split(mySelectedValue,",") 
    | mvexpand ASSIGNED 
    | eval count=0 
    | table ASSIGNED count] | stats sum(count) as Count by ASSIGNED
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 13:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440113#M125155</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-06-07T13:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: When the value is not showed in the result also i need to dispaly value as 0 in the result set ..</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440114#M125156</link>
      <description>&lt;P&gt;Add something like this after your existing code...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename COMMENT as "Add a zero record for each desired person ASSIGNED, and then stats them together "
| append [| makeresults 
    | eval ASSIGNED=mvappend("Cool","Super","Thunder","Lightray","Bluesky") 
    | mvexpand ASSIGNED 
    | eval Usage=0 
    | table ASSIGNED Usage
    ]
| stats sum(Usage) as Usage by ASSIGNED
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jun 2018 14:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440114#M125156</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-07T14:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: When the value is not showed in the result also i need to dispaly value as 0 in the result set ..</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440115#M125157</link>
      <description>&lt;P&gt;@kamlesh_vaghela&lt;/P&gt;

&lt;P&gt;convert your comment as answer. So i can vote it ..&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 14:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-the-value-is-not-showed-in-the-result-also-i-need-to/m-p/440115#M125157</guid>
      <dc:creator>Shan</dc:creator>
      <dc:date>2018-06-11T14:41:36Z</dc:date>
    </item>
  </channel>
</rss>

