<?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: easiest way to detect if splunk forwarder is running on 150 servers in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135510#M27894</link>
    <description>&lt;P&gt;try this&lt;BR /&gt;
| metadata type=hosts &lt;BR /&gt;
| eval lastHour=relative_time(now(),"-1h@h") &lt;BR /&gt;
| eval yesterday=relative_time(now(), "-1d@d") &lt;BR /&gt;
| where ( recentTime&amp;gt;yesterday AND recentTime&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 08:30:38 GMT</pubDate>
    <dc:creator>rameshyedurla</dc:creator>
    <dc:date>2020-09-29T08:30:38Z</dc:date>
    <item>
      <title>easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135500#M27884</link>
      <description>&lt;P&gt;Hey There,&lt;BR /&gt;
I am new to splunk(Please go easy on my knowledge :)). We have 150 servers that has splunk forwarders on it. We want to check the status of the forwarders(stopped/running) on a regular basis. I know there's a topic around this (check if hosts are sending any events. if no, forwarder isn't running). Big question, how can i be sure that it's forwarder problem and not the host itself? If you can provide a sample search, that'd be great!. Thank you for you time.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 16:24:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135500#M27884</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-04-17T16:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135501#M27885</link>
      <description>&lt;P&gt;There is no way in Splunk to tell if a host is up or running. As you pointed out, there are lots of searches to tell if the Splunk forwarder on a host is communicating to the indexers - but not if the host itself is up/down. Here is an example:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/41447/queryalert-to-detect-if-a-light-forwarder-stops-reporting-to-deployment-server"&gt;Query/Alert to detect if a forwarder stops reporting...&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;HOWEVER, you could write a script (for Linux, Windows or Python) that runs every few minutes and tests for the status of hosts. For example, the script could output a line for each host like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;timestamp&amp;gt; hostname=xyz status=up
&amp;lt;timestamp&amp;gt; hostname=abc status=down
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then you could have Splunk monitor this file and use it to report the status of hosts.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 17:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135501#M27885</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-04-17T17:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135502#M27886</link>
      <description>&lt;P&gt;In a nutshell, you need to search both for forwarders and for the hosts.  Then you can determine if it's a host problem or a forwarder problem.&lt;/P&gt;

&lt;P&gt;Here is the dashboard panel I use for this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="HiddenSearch" layoutPanel="panel_row5_col1" autoRun="True"&amp;gt;
&amp;lt;!-- Find and report on all Splunk Universal Forwarders and endpoints not running SUF.  Skip IPs in the SUFExceptions file. --&amp;gt;
&amp;lt;param name="search"&amp;gt;&amp;lt;![CDATA[index=_internal source="/opt/splunk/var/log/splunk/metrics.log*" sourcetype="splunkd" fwdType="*" | 
    dedup sourceHost | rename IPAddress AS hostip, sourceHost AS IPAddress, OS AS fOS | 
    fields IPAddress, hostname, fGUID, fOS, fwdType | append [loadjob savedsearch="my:app:HWDetailBase" |
    rename OS AS hOS | fields IPAddress, ComputerName, hOS] | 
    transaction IPAddress | 
    eval HostName=coalesce(ComputerName, hostname) | eval OS=coalesce(hOS, fOS) | 
    eval "Forwarder State"=if(isnotnull(fwdType),"Running","NOT RUNNING") |
    search [|inputlookup SUFExceptions.csv append=f| fields IPAddress |format "NOT (" "(" "" ")" "OR" ")"] |
    sort "Forwarder State" | table IPAddress, HostName, OS, "Forwarder State"
  ]]&amp;gt;&amp;lt;/param&amp;gt;
&amp;lt;param name="groupLabel"&amp;gt;Forwarder Status&amp;lt;/param&amp;gt;
&amp;lt;module name="JobProgressIndicator"&amp;gt;&amp;lt;/module&amp;gt;
&amp;lt;param name="earliest"&amp;gt;-24h&amp;lt;/param&amp;gt;
&amp;lt;param name="latest"&amp;gt;now&amp;lt;/param&amp;gt;
&amp;lt;module name="PostProcess" layoutPanel="panel_row5_col1"&amp;gt;
  &amp;lt;param name="search"&amp;gt; | rename "Forwarder State" AS fState | 
                          stats count(eval(fState=="NOT RUNNING")) AS nRun&amp;lt;/param&amp;gt;
  &amp;lt;module name="HTML" layoutPanel="panel_row5_col1"&amp;gt;
    &amp;lt;param name="html"&amp;gt;&amp;lt;![CDATA[
      &amp;lt;table&amp;gt;
      &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Hosts:&amp;lt;/td&amp;gt;&amp;lt;td width=3&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;$results.resultCount$&amp;lt;/td&amp;gt;&amp;lt;td width=8&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Not running:&amp;lt;/td&amp;gt;&amp;lt;td width=3&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;$results[0].nRun$&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
      &amp;lt;/table&amp;gt;
      ]]&amp;gt;&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The SUFExceptions.csv file contains a single field, IPAddress, and is where I put hosts I know aren't running a forwarder.  It saves modifying a lengthy &lt;CODE&gt;where&lt;/CODE&gt; clause every time there's a change to the exception list.&lt;/P&gt;

&lt;P&gt;The HWDetailBase search is a bit too long to list here, but it essentially combines all of our sources of host information (such as port_scan) and returns IPAddress, ComputerName, and OS fields.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Apr 2014 17:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135502#M27886</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-04-17T17:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135503#M27887</link>
      <description>&lt;P&gt;Thank you Iguinn! i will try thee method you posted. I appreciate your time &amp;amp; help.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 03:55:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135503#M27887</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-04-18T03:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135504#M27888</link>
      <description>&lt;P&gt;Thank you Rich! will try and keep you posted. I appreciate your time and help.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 03:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135504#M27888</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-04-18T03:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135505#M27889</link>
      <description>&lt;P&gt;Have not you tried Deployment Monitor App? It's the easiest way to know if forwarder is running or not. Set an alert if some forwarder is stopped sending data. It also provides missing sourcetype,source, indexing status...&lt;/P&gt;

&lt;P&gt;There you go&lt;BR /&gt;
&lt;A href="http://apps.splunk.com/app/1294/"&gt;Splunk Deployment Monitor&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2014 06:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135505#M27889</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-04-18T06:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135506#M27890</link>
      <description>&lt;P&gt;It Worked!!!! Awesome&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 16:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135506#M27890</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-05-01T16:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135507#M27891</link>
      <description>&lt;P&gt;We are in the process &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 16:25:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135507#M27891</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-05-01T16:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135508#M27892</link>
      <description>&lt;P&gt;This is the one which we are using currently.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=tcpin_connections earliest=-2d@d 
| eval Host=coalesce(hostname, sourceHost)
| eval age = (now() - _time )   
| stats  min(age) as age, max(_time) as LastTime by Host   
| convert  ctime(LastTime) as "Last Active On"   
| eval  Status= case(age &amp;lt; 1800,"Running",age &amp;gt; 1800,"DOWN") | rename age as Age   
| sort Status | table Host, Status, Age, "Last Active On" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Criteria to define if a forwarder is Running or Down is that if no heartbeat is received for 30 min its Down and running otherwise&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 18:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135508#M27892</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-05-01T18:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135509#M27893</link>
      <description>&lt;P&gt;Hi Somesh,&lt;BR /&gt;
I got some inconsistent result where i saw min(age) doesn't give proper timings. I have replaced it with latest i think that gives proper results. What do you think? &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats  latest(age) as age, max(_time) as LastTime by Host   &lt;BR /&gt;
| convert  ctime(LastTime) as "Last Active On"   &lt;BR /&gt;
| eval  Status= case(age &amp;lt; 100,"Running",age &amp;gt; 900,"DOWN") | rename age as Age  |eval Hour=round(Age/3600,0)|eval Minute=round((Age%3600)/60,0)|eval Age="-".Hour."h"." : ".Minute."m"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 12:44:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135509#M27893</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-10-24T12:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135510#M27894</link>
      <description>&lt;P&gt;try this&lt;BR /&gt;
| metadata type=hosts &lt;BR /&gt;
| eval lastHour=relative_time(now(),"-1h@h") &lt;BR /&gt;
| eval yesterday=relative_time(now(), "-1d@d") &lt;BR /&gt;
| where ( recentTime&amp;gt;yesterday AND recentTime&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:30:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135510#M27894</guid>
      <dc:creator>rameshyedurla</dc:creator>
      <dc:date>2020-09-29T08:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135511#M27895</link>
      <description>&lt;P&gt;I was just curious if you would be willing to share the script you wrote?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 16:14:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135511#M27895</guid>
      <dc:creator>mmensch</dc:creator>
      <dc:date>2016-02-02T16:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135512#M27896</link>
      <description>&lt;P&gt;In newest version of splunk the use of &lt;A href="https://splunkbase.splunk.com/app/1294/#/documentation"&gt;Splunk Deployment Monitor&lt;/A&gt; has been deprecated.&lt;BR /&gt;
Suggested is to use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/DMC/DMCoverview"&gt;Splunk Deployment Monitor&lt;/A&gt; instead.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 10:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135512#M27896</guid>
      <dc:creator>Cesaredf</dc:creator>
      <dc:date>2016-02-04T10:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135513#M27897</link>
      <description>&lt;P&gt;@Cesaredf - I think you mean the Distributed Management Console (DMC). In Splunk 6.3, the DMC can track forwarders and report if a forwarder goes "missing."&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 17:21:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135513#M27897</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-02-04T17:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135514#M27898</link>
      <description>&lt;P&gt;Yes I meant DMC &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/DMC/DMCoverview"&gt;http://docs.splunk.com/Documentation/Splunk/latest/DMC/DMCoverview&lt;/A&gt;&lt;BR /&gt;
Thanks, C.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 18:39:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135514#M27898</guid>
      <dc:creator>Cesaredf</dc:creator>
      <dc:date>2016-02-04T18:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: easiest way to detect if splunk forwarder is running on 150 servers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135515#M27899</link>
      <description>&lt;P&gt;@Raghav2384 could you please share script or suggest something on this to me and @mmensch &lt;BR /&gt;
thanks in advance&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2016 13:06:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/easiest-way-to-detect-if-splunk-forwarder-is-running-on-150/m-p/135515#M27899</guid>
      <dc:creator>saurabh_tek</dc:creator>
      <dc:date>2016-09-25T13:06:35Z</dc:date>
    </item>
  </channel>
</rss>

