<?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: Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26256#M177640</link>
    <description>&lt;P&gt;How can i use wild card character in this scenario when i just have a search pattern like incident name INC* in place of John&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2016 06:39:26 GMT</pubDate>
    <dc:creator>surekhasplunk</dc:creator>
    <dc:date>2016-11-09T06:39:26Z</dc:date>
    <item>
      <title>Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26252#M177636</link>
      <description>&lt;P&gt;I'm new to splunk and it's a little over my head. Please forgive me. I loaded data from a csv file into splunk. The csv file contains two column headers--one text and one numerical.  &lt;/P&gt;

&lt;P&gt;Column A - "John", "Jack", "Tom", "John"&lt;BR /&gt;
Column B - 9, 7, 5, 3&lt;/P&gt;

&lt;P&gt;Is it possible in splunk (or a third party method) to sum field A where Field B does NOT contain a specific word? Using the example above, sum all the fields in Column B where Column A is NOT equal to "John." If yes, please provide some concrete examples or at least a push in the right direction would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2013 05:39:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26252#M177636</guid>
      <dc:creator>handygecko</dc:creator>
      <dc:date>2013-02-09T05:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26253#M177637</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;source=myfile.csv | where A!="John" | stats sum(B)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Feb 2013 08:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26253#M177637</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-02-09T08:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26254#M177638</link>
      <description>&lt;P&gt;Thank you! This answered my question and many others. I also discovered--for anyone who may read this later--that 'where' can be omitted:&lt;/P&gt;

&lt;P&gt;source=myfile.csv A!="John" | stats sum(B)&lt;/P&gt;

&lt;P&gt;and wildcards can be used:&lt;/P&gt;

&lt;P&gt;source=myfile.csv | where A!="Jo*" | stats sum(B)&lt;/P&gt;

&lt;P&gt;Thanks again for the help.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2013 17:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26254#M177638</guid>
      <dc:creator>handygecko</dc:creator>
      <dc:date>2013-02-09T17:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26255#M177639</link>
      <description>&lt;P&gt;one more thing. If you need multiple sums, you can do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source=myfile.csv
| stats sum(eval(if(A!="John",B,null()))) as sumifnotjohn
        sum(eval(if(A=="John",B,null()))) as sumifjohn
        sum(B) as totalsum
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Feb 2013 19:27:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26255#M177639</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-02-09T19:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26256#M177640</link>
      <description>&lt;P&gt;How can i use wild card character in this scenario when i just have a search pattern like incident name INC* in place of John&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 06:39:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26256#M177640</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2016-11-09T06:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionals - is there a way in splunk to sum field A if Field B does NOT contain a specific word?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26257#M177641</link>
      <description>&lt;P&gt;I also second what @surekhasplunk has commented. Instead of (A=="John"), use (A=="John*") for the case when you have John1, John2, John3..... and so on in Column A. It (eval) doesn't seem to accept wildcards, at least when I attempted this approach. &lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:57:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionals-is-there-a-way-in-splunk-to-sum-field-A-if-Field-B/m-p/26257#M177641</guid>
      <dc:creator>l1bertyx</dc:creator>
      <dc:date>2018-11-16T16:57:25Z</dc:date>
    </item>
  </channel>
</rss>

