<?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: Need help displaying null results in a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473485#M133214</link>
    <description>&lt;PRE&gt;&lt;CODE&gt; index=toto sourcetype="winhostmon" Type=Service  Name=""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check this result.&lt;/P&gt;

&lt;P&gt;If this query returns results, the previous query should be fine.&lt;/P&gt;

&lt;P&gt;If it does not return, there is no terminal that does not contain an agent.&lt;/P&gt;</description>
    <pubDate>Sat, 02 Nov 2019 06:51:05 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2019-11-02T06:51:05Z</dc:date>
    <item>
      <title>Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473477#M133206</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;With the search below, I would like to be able to display in my table the host which have also "No SPLUNK Agent"&lt;BR /&gt;
Actually, I have only the "SPLUNK Agent is present"&lt;BR /&gt;
How I can do this, please?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| inputlookup host.csv 
    | table host]   index=toto sourcetype="winhostmon" Type=Service Name=SplunkForwarder
| stats latest(Name) as "SPLUNK Service" by host 
| eval "SPLUNK agent status"=if(isnotnull("SPLUNK Service"),"SPLUNK Agent is present", "No SPLUNK Agent") 
| search "SPLUNK agent status"="No SPLUNK Agent" 
| rename host as Hostname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Nov 2019 15:20:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473477#M133206</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-11-01T15:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473478#M133207</link>
      <description>&lt;P&gt;&lt;CODE&gt;index=toto sourcetype="winhostmon" Type=Service Name=SplunkForwarder&lt;/CODE&gt;&lt;BR /&gt;
By this search,&lt;BR /&gt;
&lt;CODE&gt;Name = SplunkForwarder&lt;/CODE&gt;&lt;BR /&gt;
We are searching only for those that are.&lt;BR /&gt;
Therefore, the next if statement can only be true.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [| inputlookup host.csv 
     | table host]     index=toto sourcetype="winhostmon" Type=Service 
 | stats latest(Name) as "SPLUNK Service" by host 
 | eval "SPLUNK agent status"=if(("SPLUNK Service"!="","SPLUNK Agent is present", "No SPLUNK Agent") 
 | stats list(host) as Hostname by "SPLUNK agent status"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 15:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473478#M133207</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-01T15:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473479#M133208</link>
      <description>&lt;P&gt;You already are filtering to only those Hosts which have a Name value. Remove that. and if my guess about what you're trying to achieve is right, you need to move that to the if statement&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=toto sourcetype="winhostmon" Type=Service [| inputlookup host.csv 
     | table host] 
 | stats latest(Name) as Name by host 
 | eval "SPLUNK agent status"=if(Name=="SplunkForwarder","SPLUNK Agent is present", "No SPLUNK Agent") 
 | search "SPLUNK agent status"="No SPLUNK Agent" 
 | rename host as Hostname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Nov 2019 17:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473479#M133208</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-01T17:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473480#M133209</link>
      <description>&lt;P&gt;I think this is what you're after:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [| inputlookup host.csv 
      | table host]     index=toto sourcetype="winhostmon" Type=Service 
| stats values(Name) AS "Names" by host
| eval "SPLUNK agent status" = if(isnull(mvfind(Names,"SplunkForwarder")),"No SPLUNK Agent","SPLUNK Agent is present")
| search "SPLUNK agent status" = "No SPLUNK Agent"
| rename host AS Hostname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't want the Names column, add in this line before the rename at the bottom:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields - Names
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Test query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=20
| eval raw=split("SplunkForwarder,SMTP_Server,WWW_Publishing,Server,Workstation",",")
| eval Name=mvindex(raw,random()%4)
| eval alphabet=split("abcdefg","")
| eval host=mvindex(alphabet,random()%7)
| table host Name
`comment("Mocked-up sample data with credit to to4kawa")`
| stats values(Name) AS "Names" by host
| eval "SPLUNK agent status" = if(isnull(mvfind(Names,"SplunkForwarder")),"No SPLUNK Agent","SPLUNK Agent is present")
| search "SPLUNK agent status" = "No SPLUNK Agent"
| rename host AS Hostname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope that helps!&lt;BR /&gt;
rmmiller&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 17:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473480#M133209</guid>
      <dc:creator>rmmiller</dc:creator>
      <dc:date>2019-11-01T17:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473481#M133210</link>
      <description>&lt;P&gt;Thank you for the name in the comment &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 19:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473481#M133210</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-01T19:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473482#M133211</link>
      <description>&lt;P&gt;hi, same problem&lt;BR /&gt;
the events corresponding to "SPLUNK Agent is present" are well displayed but the events corresponding to "No SPLUNK Agent" are not...&lt;BR /&gt;
I remind just a thing : "No SPLUNK Agent" means that SPLUNK agent is not installed as a consequence the host corresponding in host.csv dont obviously generate events...&lt;BR /&gt;
So why your code doesnt let to display "No SPLUNK Agent" events??&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 06:04:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473482#M133211</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-11-02T06:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473483#M133212</link>
      <description>&lt;P&gt;it seems to work thanks&lt;BR /&gt;
last question : I want to count the number of hosts with a "No SPLUNK Agent" status&lt;BR /&gt;
what is the better way to do this please??&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 06:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473483#M133212</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-11-02T06:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473484#M133213</link>
      <description>&lt;P&gt;complex but thanks to your help!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 06:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473484#M133213</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-11-02T06:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473485#M133214</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index=toto sourcetype="winhostmon" Type=Service  Name=""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Check this result.&lt;/P&gt;

&lt;P&gt;If this query returns results, the previous query should be fine.&lt;/P&gt;

&lt;P&gt;If it does not return, there is no terminal that does not contain an agent.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 06:51:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473485#M133214</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-11-02T06:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help displaying null results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473486#M133215</link>
      <description>&lt;P&gt;@jip31 I you just want the total count, you can add &lt;CODE&gt;| stats count(host) as total&lt;/CODE&gt; to the end of the query posted above.&lt;BR /&gt;
If you need the total as an additional column, add &lt;CODE&gt;| eventstats count(host)&lt;/CODE&gt; as total to the end of the query posted above&lt;/P&gt;

&lt;P&gt;Cheers. &lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2019 11:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-displaying-null-results-in-a-table/m-p/473486#M133215</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-02T11:43:11Z</dc:date>
    </item>
  </channel>
</rss>

