<?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 count 0 for the field value which is not matching with events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695148#M236404</link>
    <description>&lt;P&gt;First of all, you need to illustrate your data and corresponding lookup entries to prove that the output is incorrect. &amp;nbsp;Otherwise it is just that your lookup has nothing matching raw event.&lt;/P&gt;&lt;P&gt;Second, from a glance, it looks like your events uses lower case whereas your lookup values are in upper case. &amp;nbsp;You need to ask yourself: Is this necessary? &amp;nbsp;If it is necessary, does your lookup have case_sensitive_match=0? &amp;nbsp;A second question you need to answer is: the lookup contains wildcards. &amp;nbsp;Is the lookup set up with matchtype=WILDCARD(host)?&lt;/P&gt;</description>
    <pubDate>Sat, 03 Aug 2024 03:47:55 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2024-08-03T03:47:55Z</dc:date>
    <item>
      <title>How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695026#M236360</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;
&lt;P&gt;My requirement is below .&lt;/P&gt;
&lt;P&gt;I have lookup where 7 hosts defined . when my search is running for both tstats and stats I only get 5 hosts count which are greater than 0 . Can someone help how can we get count 0 for the field which we are passing from lookup .&lt;/P&gt;
&lt;P&gt;Query :&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats count max(_time) AS latest_event_time where index=firewall sourcetype="cisco:ftd" [| inputlookup Firewall_list.csv | table Primary | Rename Primary AS host] groupby host  &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Aug 2024 23:37:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695026#M236360</guid>
      <dc:creator>ssuluguri</dc:creator>
      <dc:date>2024-08-01T23:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695029#M236362</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count max(_time) AS latest_event_time where index=firewall sourcetype="cisco:ftd" [| inputlookup Firewall_list.csv | table Primary | Rename Primary AS host] groupby host
| append [|inputlookup Firewall_list.csv | table Primary | Rename Primary AS host | eval count=0]
| stats sum(count) as count max(latest_event_time) AS latest_event_time by host&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 01 Aug 2024 21:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695029#M236362</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-01T21:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695033#M236364</link>
      <description>&lt;P&gt;Additionally, you should drop the subsearch with inputlookup because either the lookup contains any host that could ever have, or you should &lt;EM&gt;want&lt;/EM&gt; to catch any count from hosts that are not in the lookup.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count max(_time) AS latest_event_time where index=firewall sourcetype="cisco:ftd" groupby host
| append [|inputlookup Firewall_list.csv | table Primary | Rename Primary AS host | eval count=0]
| stats sum(count) as count max(latest_event_time) AS latest_event_time by host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 23:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695033#M236364</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-08-01T23:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695116#M236393</link>
      <description>&lt;P&gt;Thanks for your time , I see the data which is coming 0 for each entry coming from lookup but it should give only value 0 for the host which is not sending events .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssuluguri_0-1722622847669.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32020i26C8BC681F963FD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ssuluguri_0-1722622847669.png" alt="ssuluguri_0-1722622847669.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 18:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695116#M236393</guid>
      <dc:creator>ssuluguri</dc:creator>
      <dc:date>2024-08-02T18:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695118#M236394</link>
      <description>&lt;P&gt;This is not giving results which needed , I see 0 for each entry from lookup&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssuluguri_0-1722622938780.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32021i0E877A20D97EEE53/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ssuluguri_0-1722622938780.png" alt="ssuluguri_0-1722622938780.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2024 18:22:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695118#M236394</guid>
      <dc:creator>ssuluguri</dc:creator>
      <dc:date>2024-08-02T18:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695148#M236404</link>
      <description>&lt;P&gt;First of all, you need to illustrate your data and corresponding lookup entries to prove that the output is incorrect. &amp;nbsp;Otherwise it is just that your lookup has nothing matching raw event.&lt;/P&gt;&lt;P&gt;Second, from a glance, it looks like your events uses lower case whereas your lookup values are in upper case. &amp;nbsp;You need to ask yourself: Is this necessary? &amp;nbsp;If it is necessary, does your lookup have case_sensitive_match=0? &amp;nbsp;A second question you need to answer is: the lookup contains wildcards. &amp;nbsp;Is the lookup set up with matchtype=WILDCARD(host)?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 03:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695148#M236404</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-08-03T03:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695153#M236408</link>
      <description>&lt;P&gt;Your lookup seems to contain wildcarded entries. How is Splunk supposed to know what hosts this should match (assuming you even have your lookup defined correctly with a wildcard match) if you have no events to match with?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Aug 2024 08:32:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695153#M236408</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-08-03T08:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695325#M236444</link>
      <description>&lt;P&gt;Thanks a lot it worked .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding to that&amp;nbsp;I m passing two values from lookup as below , if both hosts event count is zero then I need the result to display the host name which are passing from lookup . Can you help me here .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssuluguri_0-1722882112347.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32065iA3D889F032CE855A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ssuluguri_0-1722882112347.png" alt="ssuluguri_0-1722882112347.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 18:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695325#M236444</guid>
      <dc:creator>ssuluguri</dc:creator>
      <dc:date>2024-08-05T18:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695326#M236445</link>
      <description>&lt;P&gt;Overall our requirement is that " We are passing a lookup where both Primary and Secondary devices defined , if only both stopped sending the events then we need to display the hosts "&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is the query I prepared , but not giving the exact requirement , can you optimize , help .&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| tstats count max(_time) AS latest_event_time where index=firewall sourcetype="cisco:ftd" [| inputlookup Firewall_list.csv | table Primary | Rename Primary AS host] groupby host
| append [|inputlookup Firewall_list.csv | table Primary | Rename Primary AS host | eval count=0]
| stats sum(count) as count max(latest_event_time) AS latest_event_time by host |rename host as Pri

&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;|append [| tstats count max(_time) AS latest_event_time where index=firewall sourcetype="cisco:ftd" [| inputlookup Firewall_list.csv | table Secondary | Rename Secondary AS host] groupby host
| append [|inputlookup Firewall_list.csv | table Secondary | Rename Secondary AS host | eval count=0]
| stats sum(count) as count max(latest_event_time) AS latest_event_time by host |rename host as Sec]

&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;Host are in lookup&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ssuluguri_0-1722882650311.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32066i6FE6255EBF29D7D5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ssuluguri_0-1722882650311.png" alt="ssuluguri_0-1722882650311.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2024 18:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695326#M236445</guid>
      <dc:creator>ssuluguri</dc:creator>
      <dc:date>2024-08-05T18:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695346#M236449</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count max(_time) AS latest_event_time where index=firewall sourcetype="cisco:ftd" [| inputlookup Firewall_list.csv | table Primary | Rename Primary AS host] OR [| inputlookup Firewall_list.csv | table Primary | Rename Secondary AS host] groupby host
``` append host (Primary) and Primary for all primaries ```
| append [|inputlookup Firewall_list.csv | table Primary | eval host=Primary | eval count=0]
``` append host (Secondary) and Primary for all secondaries ```
| append [|inputlookup Firewall_list.csv | rename Secondary as host | eval count=0]
``` count for all hosts noting last event time and Primary ```
| stats sum(count) as count max(latest_event_time) AS latest_event_time values(Primary) as Primary by host 
``` find all host not reporting ```
| where count = 0
``` count hosts for each Primary not reporting ```
| eventstats count as hosts_not_reporting by Primary
``` find where both hosts are not reporting ```
| where hosts_not_reporting = 2&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 05 Aug 2024 23:07:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695346#M236449</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-08-05T23:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get count 0 for the field value which is not matching with events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695591#M236513</link>
      <description>&lt;P&gt;Appreciated for the time you spent on it , it worked .&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 17:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-count-0-for-the-field-value-which-is-not-matching/m-p/695591#M236513</guid>
      <dc:creator>ssuluguri</dc:creator>
      <dc:date>2024-08-07T17:26:55Z</dc:date>
    </item>
  </channel>
</rss>

