<?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: Comparing Values Based on Another Field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475461#M133619</link>
    <description>&lt;P&gt;Here is one way to do it, using Run Anywhere SPL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval raw="File=A,Method=Fail File=A,Method=Success File=A,Method=Fail File=B,Method=File File=B,Method=Success File=C,Method=Fail File=C,Method=Success File=C,Method=Fail File=A,Method=Success File=A,Method=Success File=B,Method=Fail"
| makemv raw | mvexpand raw | rename raw AS _raw | kv
| table File Method
| stats count AS Vol by File,Method
| xyseries File Method Vol
| where Fail&amp;gt;Success
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 13 Apr 2020 17:12:32 GMT</pubDate>
    <dc:creator>jpolvino</dc:creator>
    <dc:date>2020-04-13T17:12:32Z</dc:date>
    <item>
      <title>Comparing Values Based on Another Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475460#M133618</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I'm thinking is real simple, but I have been digging in the weeds for so long I am unable to see this simple answer.&lt;/P&gt;

&lt;P&gt;Field Names: &lt;STRONG&gt;File&lt;/STRONG&gt;, &lt;STRONG&gt;Method&lt;/STRONG&gt;&lt;BR /&gt;
Field Values: &lt;STRONG&gt;File&lt;/STRONG&gt; - &lt;EM&gt;A&lt;/EM&gt;, &lt;EM&gt;B&lt;/EM&gt;, &lt;EM&gt;C&lt;/EM&gt;   &lt;STRONG&gt;Method&lt;/STRONG&gt; - &lt;EM&gt;Success&lt;/EM&gt;, &lt;EM&gt;Fail&lt;/EM&gt;&lt;BR /&gt;
Counting the number of events by &lt;STRONG&gt;File&lt;/STRONG&gt;/&lt;STRONG&gt;Method&lt;/STRONG&gt; combination&lt;BR /&gt;
Searching for &lt;STRONG&gt;File&lt;/STRONG&gt;(s) where the count of &lt;EM&gt;Fail&lt;/EM&gt; is greater than the count of &lt;EM&gt;Success&lt;/EM&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count(status) AS numEvents BY file, statusMsg
| sort numEvents
| stats list(statusMsg) AS "HTTP Method", list(numEvents) AS "Events by Method", sum(numEvents) AS sumEvents BY file
| rename file AS "File Name", sumEvents AS "Events by File"
| sort -"Events by File"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;This is a file we don't want in our results.
badNum.doc  
500 Internal Server Error     12
200 Success                  149

This is a file we do want in our results.
UPDATE_NEW.doc                  
200 Success                  116
500 Internal Server Error    475
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 16:52:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475460#M133618</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-13T16:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values Based on Another Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475461#M133619</link>
      <description>&lt;P&gt;Here is one way to do it, using Run Anywhere SPL:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval raw="File=A,Method=Fail File=A,Method=Success File=A,Method=Fail File=B,Method=File File=B,Method=Success File=C,Method=Fail File=C,Method=Success File=C,Method=Fail File=A,Method=Success File=A,Method=Success File=B,Method=Fail"
| makemv raw | mvexpand raw | rename raw AS _raw | kv
| table File Method
| stats count AS Vol by File,Method
| xyseries File Method Vol
| where Fail&amp;gt;Success
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2020 17:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475461#M133619</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-04-13T17:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values Based on Another Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475462#M133620</link>
      <description>&lt;P&gt;@jpolvino &lt;BR /&gt;
Thanks for the quick response. &lt;BR /&gt;
My post was very generic/minimal. We have over 70 Files. And the number of methods covers all of the HTTP methods: 200 range, 300 range, 400 range, and 500 range.&lt;BR /&gt;
Thanks and God bless,&lt;BR /&gt;
Genesius&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 17:23:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475462#M133620</guid>
      <dc:creator>genesiusj</dc:creator>
      <dc:date>2020-04-13T17:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Values Based on Another Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475463#M133621</link>
      <description>&lt;P&gt;Ok then, you'll have to use a new "status" field. Here is an example where 200 is defined as "Pass" and everything else is "Fail"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval raw="File=A,Method=200 File=A,Method=300 File=A,Method=400 File=B,Method=500 File=B,Method=200 File=C,Method=300 File=C,Method=500 File=C,Method=500 File=A,Method=500 File=A,Method=200 File=B,Method=400"
| makemv raw | mvexpand raw | rename raw AS _raw | kv
| table File Method
| eval status=if(Method==200,"Pass","Fail")
| stats count AS Vol by File,status
| xyseries File status Vol
| where Fail&amp;gt;Pass
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2020 17:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Comparing-Values-Based-on-Another-Field/m-p/475463#M133621</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-04-13T17:28:54Z</dc:date>
    </item>
  </channel>
</rss>

