<?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: Help with host not reporting search in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357857#M9615</link>
    <description>&lt;P&gt;General guidelines - 1) eliminate records as early as possible 2) calculations that matter before reformats and renames 3) renames that make the names clumsy to program as LATE as possible. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts | search host=* 
| eval HostStatus=if(lastTime&amp;lt;relative_time(now(),"-10m"),"Not Reporting","Reporting") 
| fieldformat lastTime=strftime(lastTime, "%c") 
| rename host as Host, lastTime as "Last Event" 
| table Host "Last Event" HostStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Final note = %c format is REALLY clumsy to read or to scan down.  Try this instead...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval "Last Event"=strftime(lastTime, "%Y-%m-%d %H:%M:%S.%3Q").case(relative_time(lastTime,"@d")=relative_time(now(),"@d")," ... (today)",
    relative_time(lastTime,"@d")&amp;gt;=relative_time(now(),"-1d@d")," ... (yesterday)",
    relative_time(lastTime,"@d")&amp;gt;=relative_time(now(),"-6d@d")," ... (last ".strftime(lastTime, "%A").")",
    relative_time(lastTime,"@d")&amp;gt;=relative_time(now(),"-70d@d")," ... (".round((now()-lastTime)/86400/7)." weeks ago)",
    true()," ... long ago")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Aug 2017 18:05:55 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-08-07T18:05:55Z</dc:date>
    <item>
      <title>Help with host not reporting search</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357856#M9614</link>
      <description>&lt;P&gt;Looking for assistance with a search - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts | rename lastTime as "Last Event"| search host=**** | fieldformat "Last Event"=strftime('Last Event', "%c") | table host "Last Event" | rename host as Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search currently provides host and last reported event. I'm hoping to add one more column that essentially gives me a "Host Reporting" or "Host Not Reporting" based on last event time. "If "Last Event" is &amp;gt;10 minutes, show as "Host Not Reporting" &lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 13:15:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357856#M9614</guid>
      <dc:creator>SMWickman</dc:creator>
      <dc:date>2017-08-07T13:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with host not reporting search</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357857#M9615</link>
      <description>&lt;P&gt;General guidelines - 1) eliminate records as early as possible 2) calculations that matter before reformats and renames 3) renames that make the names clumsy to program as LATE as possible. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts | search host=* 
| eval HostStatus=if(lastTime&amp;lt;relative_time(now(),"-10m"),"Not Reporting","Reporting") 
| fieldformat lastTime=strftime(lastTime, "%c") 
| rename host as Host, lastTime as "Last Event" 
| table Host "Last Event" HostStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Final note = %c format is REALLY clumsy to read or to scan down.  Try this instead...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval "Last Event"=strftime(lastTime, "%Y-%m-%d %H:%M:%S.%3Q").case(relative_time(lastTime,"@d")=relative_time(now(),"@d")," ... (today)",
    relative_time(lastTime,"@d")&amp;gt;=relative_time(now(),"-1d@d")," ... (yesterday)",
    relative_time(lastTime,"@d")&amp;gt;=relative_time(now(),"-6d@d")," ... (last ".strftime(lastTime, "%A").")",
    relative_time(lastTime,"@d")&amp;gt;=relative_time(now(),"-70d@d")," ... (".round((now()-lastTime)/86400/7)." weeks ago)",
    true()," ... long ago")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Aug 2017 18:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357857#M9615</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-07T18:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Help with host not reporting search</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357858#M9616</link>
      <description>&lt;P&gt;up vote for detailed answer,&lt;BR /&gt;
@SMWickman be careful when using the metadata command as its not always accurate.&lt;BR /&gt;
read this answer for detailed explanation:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/294791/accuracy-of-metadata-command-in-large-environments.html"&gt;https://answers.splunk.com/answers/294791/accuracy-of-metadata-command-in-large-environments.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 18:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357858#M9616</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-08-07T18:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help with host not reporting search</title>
      <link>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357859#M9617</link>
      <description>&lt;P&gt;Thank you! Appreciate the detailed response!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 18:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Help-with-host-not-reporting-search/m-p/357859#M9617</guid>
      <dc:creator>SMWickman</dc:creator>
      <dc:date>2017-08-07T18:51:35Z</dc:date>
    </item>
  </channel>
</rss>

