<?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 count files in which multiple fields meet certain conditions? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405039#M6459</link>
    <description>&lt;P&gt;@fzhao2 ,&lt;/P&gt;

&lt;P&gt;You might want an &lt;CODE&gt;OR&lt;/CODE&gt; instead of &lt;CODE&gt;AND&lt;/CODE&gt; since you dont have values for both fields at the same time.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Feb 2019 03:51:50 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-02-22T03:51:50Z</dc:date>
    <item>
      <title>How to count files in which multiple fields meet certain conditions?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405038#M6458</link>
      <description>&lt;P&gt;I have a few files. They all have the same columns and look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp           field1    field2
...
1544079360.84132    99
1544079363.52629              98
1544081067.48075              100
1544081377.48521    100
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to count the files that both field1 and field2 reached 100 or above.&lt;/P&gt;

&lt;P&gt;I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | search field1&amp;gt;=100 AND field2&amp;gt;=100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it didn't work. I believe it's because there were null values.&lt;/P&gt;

&lt;P&gt;So I tried filldown:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | filldown field1, field2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it's still not working.&lt;/P&gt;

&lt;P&gt;I also tried eventstats and no luck. And I don't prefer eventstats as it gets very slow when data is increasing.&lt;/P&gt;

&lt;P&gt;Any thoughts? Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 23:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405038#M6458</guid>
      <dc:creator>fzhao2</dc:creator>
      <dc:date>2019-02-21T23:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to count files in which multiple fields meet certain conditions?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405039#M6459</link>
      <description>&lt;P&gt;@fzhao2 ,&lt;/P&gt;

&lt;P&gt;You might want an &lt;CODE&gt;OR&lt;/CODE&gt; instead of &lt;CODE&gt;AND&lt;/CODE&gt; since you dont have values for both fields at the same time.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 03:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405039#M6459</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-22T03:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to count files in which multiple fields meet certain conditions?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405040#M6460</link>
      <description>&lt;P&gt;Hi @fzhao2, &lt;/P&gt;

&lt;P&gt;try this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....|where field1&amp;gt;=100 OR field2&amp;gt;=100 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Worked for me&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval field1="99, , ,100" 
| makemv delim="," field1 
| mvexpand field1 
| appendcols 
    [| makeresults 
    | eval field2=", ,98,100, ," 
    | makemv delim="," field2 
    | mvexpand field2] 
|where field1&amp;gt;=100 OR field2&amp;gt;=100
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Feb 2019 10:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-count-files-in-which-multiple-fields-meet-certain/m-p/405040#M6460</guid>
      <dc:creator>vinod94</dc:creator>
      <dc:date>2019-02-22T10:57:07Z</dc:date>
    </item>
  </channel>
</rss>

