<?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: How to get the latest host value which is sending logs by comparing 2 hosts? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606623#M210980</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp;, Thanks for your reply&lt;/P&gt;&lt;P&gt;I tried the spl that you gave but its condition&amp;nbsp;Is always looking for the silent_hosts count is 2.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;where silent_hosts=2&lt;/LI-CODE&gt;&lt;P&gt;Which in turn its ignoring the single host which is silent for more than 20 hours ( logs are coming from single host only for other index and sourcetype combinations from past 1 month onwards continuously) So this feeds the below query is discarding .&lt;BR /&gt;&lt;BR /&gt;I tried where silent_hosts&amp;gt;=1 then in this case its displaying the old stopped host1 . This should not display as we are getting the logs to same index and sourcetype from host2&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 08:37:17 GMT</pubDate>
    <dc:creator>raj_mpl</dc:creator>
    <dc:date>2022-07-22T08:37:17Z</dc:date>
    <item>
      <title>How to get the latest host value which is sending logs by comparing 2 hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606482#M210944</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;I have search like below where the logs are coming from the fig1,fig4,fig5,fig6 indexes from either of the 2 hosts say host1 and host2.&amp;nbsp; So at a time 2 hosts won't send logs and only any of the host will be sending the logs actively to&amp;nbsp;&lt;STRONG&gt;fig1&lt;/STRONG&gt; index with source type as &lt;STRONG&gt;abc.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats latest(_time) as latest_time WHERE (index = fig*) (NOT index IN (fig2,fig3,)) sourcetype="abc" by host index sourcetype | eval silent_in_hours=round(( now() - latest_time)/3600,2)  | where silent_in_hours&amp;gt;20 | eval latest_time=strftime(latest_time, "%m/%d/%Y %H:%M:%S")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I want to build logic to display if any of the host1 or host2 is sending the logs then the above query should not give any o/p (should not display the silent host because we are getting the log from other host).&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 14:36:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606482#M210944</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2022-07-21T14:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest host value which is sending logs by comparing 2 hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606494#M210948</link>
      <description>&lt;P&gt;I don't understand the problem.&amp;nbsp; If a host is silent and not sending events to Splunk then there will be nothing for Splunk to show in the output.&amp;nbsp; Only reporting hosts will be displayed.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 12:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606494#M210948</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-07-21T12:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest host value which is sending logs by comparing 2 hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606496#M210949</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;, If host1 is silent then as per the above logic it will show host1 is silent as per the where condition . That I should not get because host2 will be sending the logs . So we want a logic to check if any of the host is sending the log and anyone is sending the log then alert should not trigger.&lt;BR /&gt;Consider Logs will come interchangeably from host1 and host2 for every 15 days&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 12:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606496#M210949</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2022-07-21T12:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest host value which is sending logs by comparing 2 hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606522#M210953</link>
      <description>&lt;P&gt;So you want to trigger an alert if no host is sending events, correct?&amp;nbsp; If so then define an alert that triggers if this search returns zero results;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats latest(_time) as latest_time WHERE (index = fig*) (NOT index IN (fig2,fig3,)) sourcetype="abc" by host index sourcetype &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 14:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606522#M210953</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-07-21T14:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest host value which is sending logs by comparing 2 hosts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606553#M210960</link>
      <description>&lt;P&gt;1) At any point of time one host will be active and sending the logs out of the 2 hosts. so silent hours condition will becomes always false (silent hours&amp;gt;20) as we are receiving the logs so alert should not trigger&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) if both hosts silents for more than 20 hours then condition becomes true then alert should trigger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope I am clear with requirement&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 17:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606553#M210960</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2022-07-21T17:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest host value which is sending logs by comparing 2 hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606565#M210962</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats latest(_time) as latest_time WHERE (index = fig*) (NOT index IN (fig2,fig3,)) sourcetype="abc" by host index sourcetype | eval silent_in_hours=round(( now() - latest_time)/3600,2) | where silent_in_hours&amp;gt;20 | stats dc(host) as silent_hosts max(latest_time) as latest_time by index source type | where silent_hosts=2 | eval latest_time=strftime(latest_time, "%m/%d/%Y %H:%M:%S")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 20:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606565#M210962</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-07-21T20:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the latest host value which is sending logs by comparing 2 hosts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606623#M210980</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp;, Thanks for your reply&lt;/P&gt;&lt;P&gt;I tried the spl that you gave but its condition&amp;nbsp;Is always looking for the silent_hosts count is 2.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;where silent_hosts=2&lt;/LI-CODE&gt;&lt;P&gt;Which in turn its ignoring the single host which is silent for more than 20 hours ( logs are coming from single host only for other index and sourcetype combinations from past 1 month onwards continuously) So this feeds the below query is discarding .&lt;BR /&gt;&lt;BR /&gt;I tried where silent_hosts&amp;gt;=1 then in this case its displaying the old stopped host1 . This should not display as we are getting the logs to same index and sourcetype from host2&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 08:37:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-latest-host-value-which-is-sending-logs-by/m-p/606623#M210980</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2022-07-22T08:37:17Z</dc:date>
    </item>
  </channel>
</rss>

