<?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 Using an app generated log file, how to generate a search that will determine and visualize a host's running status? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282368#M85252</link>
    <description>&lt;P&gt;I'll include the "Splunk newb here" disclaimer to start off with...&lt;/P&gt;

&lt;P&gt;I have an agent that drops a new event every 50 - 55 seconds to a log file.  I'm already pulling a few reports off this log, but what I'd like to do is use this log to tell if the agent is active.  So far I have the following query (which I found on Answers):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index sourcetype=my_sourcetype
     | stats latest(_time) as latestTime by  host source 
     | eval latestTime=strftime(latestTime,"%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me a table that displays host, source, and latest time an event was registered in that file.&lt;/P&gt;

&lt;P&gt;What I'd like to do from here is perform an eval of some sort where if the latest time is older than 5m indicate the host that is missing is down.  I'd like to display it... somehow.  A pie chart was my initial thought.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Dec 2016 17:20:19 GMT</pubDate>
    <dc:creator>csprice</dc:creator>
    <dc:date>2016-12-15T17:20:19Z</dc:date>
    <item>
      <title>Using an app generated log file, how to generate a search that will determine and visualize a host's running status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282368#M85252</link>
      <description>&lt;P&gt;I'll include the "Splunk newb here" disclaimer to start off with...&lt;/P&gt;

&lt;P&gt;I have an agent that drops a new event every 50 - 55 seconds to a log file.  I'm already pulling a few reports off this log, but what I'd like to do is use this log to tell if the agent is active.  So far I have the following query (which I found on Answers):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index sourcetype=my_sourcetype
     | stats latest(_time) as latestTime by  host source 
     | eval latestTime=strftime(latestTime,"%x %X")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This gives me a table that displays host, source, and latest time an event was registered in that file.&lt;/P&gt;

&lt;P&gt;What I'd like to do from here is perform an eval of some sort where if the latest time is older than 5m indicate the host that is missing is down.  I'd like to display it... somehow.  A pie chart was my initial thought.&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 17:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282368#M85252</guid>
      <dc:creator>csprice</dc:creator>
      <dc:date>2016-12-15T17:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using an app generated log file, how to generate a search that will determine and visualize a host's running status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282369#M85253</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| metadata type=hosts |where recentTime &amp;lt; now() - 300 | eval lastSeen = strftime(recentTime, "%F %T") | fields + host lastSeen
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 18:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282369#M85253</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2016-12-15T18:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using an app generated log file, how to generate a search that will determine and visualize a host's running status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282370#M85254</link>
      <description>&lt;P&gt;Maybe this will help.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     index=my_index sourcetype=my_sourcetype
      | stats latest(_time) as latestTime by  host source 
      | eval status=if (now()-latestTime &amp;gt; 300, "Down", "Up")
      | eval latestTime=strftime(latestTime,"%x %X") | table host source status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 18:15:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282370#M85254</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-12-15T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using an app generated log file, how to generate a search that will determine and visualize a host's running status?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282371#M85255</link>
      <description>&lt;P&gt;Fantastic.  Did exactly what I was after.  Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 19:20:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-an-app-generated-log-file-how-to-generate-a-search-that/m-p/282371#M85255</guid>
      <dc:creator>csprice</dc:creator>
      <dc:date>2016-12-15T19:20:08Z</dc:date>
    </item>
  </channel>
</rss>

