<?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: Search help -- Display count if field is present in the output in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-help-Display-count-if-field-is-present-in-the-output/m-p/323166#M96439</link>
    <description>&lt;P&gt;@renjujacob88, following is based on sample data provided. Pipe the following to your existing results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval attentionFlag=case(isnotnull(threat_name),"Investigate",isnull(threat_name) AND count&amp;gt;100,"Investigate",true(),"Ignore")
| search attentionFlag="Investigate"
| fields - attentionFlag
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Sep 2017 07:06:15 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-09-05T07:06:15Z</dc:date>
    <item>
      <title>Search help -- Display count if field is present in the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-help-Display-count-if-field-is-present-in-the-output/m-p/323165#M96438</link>
      <description>&lt;P&gt;Hi Splunkers ,&lt;/P&gt;

&lt;P&gt;Need help in creating the case statement.&lt;/P&gt;

&lt;P&gt;We are feeding the palo alto logs to the threat intelligence of splunk( &lt;CODE&gt;ip_intel&lt;/CODE&gt;) to see if any blacklisted ip is hitting the perimeters. &lt;BR /&gt;
The query which I wrote is given below with the snapshot of the output&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=palo  src_ip!=10.*  | rename src_ip as ip | stats values(action) as action max(_time) as LastSeen min(_time) as FirstSeen dc(dest_ip) as dest_count values(threat_name) as threat_name values(severity) as severity count by ip|lookup ip_intel ip as ip OUTPUT description threat_key | table ip description threat_key action LastSeen FirstSeen threat_name severity dest_count count | eval description = if(isnull(description),"YES",description) | eval threat_key = if(isnull(threat_key),"YES",threat_key) | where threat_key!="YES" | convert ctime(LastSeen) ctime(FirstSeen)|&lt;BR /&gt;
Blockquote&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/209744-intel-splunk.png" alt="alt text" /&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Now we need to modify the query in such a way that if the threat_name is present in the output(field of palo alto) display the result(whatever the count may be).&lt;BR /&gt;
If the threat_name fields are empty then search for the count and display the count which is above 100.&lt;/P&gt;

&lt;P&gt;Appreciate the help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-help-Display-count-if-field-is-present-in-the-output/m-p/323165#M96438</guid>
      <dc:creator>renjujacob88</dc:creator>
      <dc:date>2020-09-29T15:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Search help -- Display count if field is present in the output</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-help-Display-count-if-field-is-present-in-the-output/m-p/323166#M96439</link>
      <description>&lt;P&gt;@renjujacob88, following is based on sample data provided. Pipe the following to your existing results:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval attentionFlag=case(isnotnull(threat_name),"Investigate",isnull(threat_name) AND count&amp;gt;100,"Investigate",true(),"Ignore")
| search attentionFlag="Investigate"
| fields - attentionFlag
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 07:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-help-Display-count-if-field-is-present-in-the-output/m-p/323166#M96439</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-09-05T07:06:15Z</dc:date>
    </item>
  </channel>
</rss>

