<?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: Lookup 0 Count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588960#M205104</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243871"&gt;@Hithere&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I was confused with another question, my answer is to have the domains with no logs.&lt;/P&gt;&lt;P&gt;If you want all the domains with status, you could use something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=application WAFRuleMessage="Anomaly Exceeded" 
| eval Domain=lower(domain)
| stats count as ct_Domain by Domain
| append [ | inputlookup mylookupfile.csv | eval Domain=lower(domain), ct_Domain=0 | fields Domain AGS ENV ct_Domain ]
| stats sum(ct_Domain) as total by AGS ENV Domain
| sort AGS -ENV -count
| eval status=if(total=0,"Not present","Present")
| table AGS ENV Domain status&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Mar 2022 16:57:45 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-03-14T16:57:45Z</dc:date>
    <item>
      <title>How to return 0 count of events from a lookup file?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588948#M205100</link>
      <description>&lt;P&gt;I'm trying to match all domains from a lookup file with a base search and get a count of the events for each one even if there are no events matching (0 count):&lt;BR /&gt;&lt;BR /&gt;mysite.com&amp;nbsp; count 12&lt;BR /&gt;anothersite.com count 5&lt;BR /&gt;myothersite.com count 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;index=application sourcetype=mysource
| lookup myfile.csv Domain as &amp;lt;corelated event field&amp;gt;
| append [ | inputlookup myfile.csv | fields Domain]
| stats count as total by Domain
| fillnull value=0 total
| table total
| sort -total&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can, please explain your answer - whether there is a syntax error, a keyword misuse, or conceptual error on my part.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 21:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588948#M205100</guid>
      <dc:creator>Hithere</dc:creator>
      <dc:date>2022-03-14T21:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup 0 Count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588954#M205102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243871"&gt;@Hithere&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=application WAFRuleMessage="Anomaly Exceeded" 
| eval Domain=lower(domain)
| stats count as ct_Domain by Domain
| append [ | inputlookup mylookupfile.csv | eval Domain=lower(domain), ct_Domain=0 | fields Domain AGS ENV ct_Domain ]
| stats sum(ct_Domain) as total by AGS ENV Domain
| sort AGS -ENV -count
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 16:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588954#M205102</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-14T16:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup 0 Count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588958#M205103</link>
      <description>&lt;P&gt;This query retrieves all the lookup domains as desired, but all the total count of events for each domain is 0 which is not expected.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hithere_0-1647276243185.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/18485iCD93EC3BBA5CD6DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hithere_0-1647276243185.png" alt="Hithere_0-1647276243185.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 16:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588958#M205103</guid>
      <dc:creator>Hithere</dc:creator>
      <dc:date>2022-03-14T16:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup 0 Count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588960#M205104</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243871"&gt;@Hithere&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I was confused with another question, my answer is to have the domains with no logs.&lt;/P&gt;&lt;P&gt;If you want all the domains with status, you could use something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=application WAFRuleMessage="Anomaly Exceeded" 
| eval Domain=lower(domain)
| stats count as ct_Domain by Domain
| append [ | inputlookup mylookupfile.csv | eval Domain=lower(domain), ct_Domain=0 | fields Domain AGS ENV ct_Domain ]
| stats sum(ct_Domain) as total by AGS ENV Domain
| sort AGS -ENV -count
| eval status=if(total=0,"Not present","Present")
| table AGS ENV Domain status&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 16:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-0-count-of-events-from-a-lookup-file/m-p/588960#M205104</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-03-14T16:57:45Z</dc:date>
    </item>
  </channel>
</rss>

