<?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 search and filter based on values matched in an eval case statement? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215658#M63213</link>
    <description>&lt;P&gt;Thanks for the reply, but the second search will match on EITHER/OR value. I only want to show results where BOTH values exists. Same issue with the first search, gives me either/or one or the other value. &lt;/P&gt;</description>
    <pubDate>Tue, 21 Jun 2016 20:19:17 GMT</pubDate>
    <dc:creator>splunker1981</dc:creator>
    <dc:date>2016-06-21T20:19:17Z</dc:date>
    <item>
      <title>How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215656#M63211</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;Trying to figure out how to search or filter based on the matches in my case statement.  I guess also want to figure out if this is the correct way to approach this search. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchHere |  eval status=case(ship=_pro, "processed", ship=_ma, "sent") | stats values(field1), values(field2), values(filed3), values(status) by fieldx 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, I want to search the contents of the &lt;CODE&gt;values()&lt;/CODE&gt; function for only those that contain both strings matched in my case statement.  I can't focus on a count because there are many other variations that could potentially match and thus making the count &amp;gt;1.  Something like "if the field status contains the values: &lt;EM&gt;processed AND sent&lt;/EM&gt;" in any order show me those events. &lt;/P&gt;

&lt;P&gt;Thanks for the help in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 19:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215656#M63211</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2016-06-21T19:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215657#M63212</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchHere (ship="_pro" OR ship="_ma"|  eval status=case(ship=_pro, "processed", ship=_ma, "sent") | stats values(field1), values(field2), values(filed3), values(status) by fieldx 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;OR&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchHere |  eval status=case(ship=_pro, "processed", ship=_ma, "sent", 1=1, "other") | search status="processed" OR status="sent" | stats values(field1), values(field2), values(filed3), values(status) by fieldx 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 20:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215657#M63212</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-21T20:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215658#M63213</link>
      <description>&lt;P&gt;Thanks for the reply, but the second search will match on EITHER/OR value. I only want to show results where BOTH values exists. Same issue with the first search, gives me either/or one or the other value. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2016 20:19:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215658#M63213</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2016-06-21T20:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215659#M63214</link>
      <description>&lt;P&gt;When you use values(), the resultant field is multi-value. This means it can have several values simultaneously. Testing for "this and that" is as simple as "mv_field=&amp;lt;value1&amp;gt; mv_field=&amp;lt;value2&amp;gt;" (the AND in between is implied). It might benefit you to use an "AS ..." clause in the stats call to rename the field to something easier to manage.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:59:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215659#M63214</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2020-09-29T09:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215660#M63215</link>
      <description>&lt;P&gt;This should do it&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated (replaced mvfind with mvfilter)&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; searchHere |  eval status=case(ship=_pro, "processed", ship=_ma, "sent") | stats values(field1), values(field2), values(filed3), values(status) as status by fieldx | where isnotnull(mvfilter(match(status,"processed"))) AND isnotnull(mvfilter(match(status,"sent")))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jun 2016 20:57:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215660#M63215</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-21T20:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215661#M63216</link>
      <description>&lt;P&gt;Thanks for the help.  I ran the search above and get the following error:&lt;BR /&gt;
Error in 'where' command: The arguments to the 'mvfind' function are invalid.&lt;/P&gt;

&lt;P&gt;I don't see anything referencing mvfind(match in the docs. Is that just saying match for the value in fieldx?   Did you mean to use mvfilter? I tried that and that seems to return just the values I'm searching for. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 19:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215661#M63216</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2016-06-22T19:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215662#M63217</link>
      <description>&lt;P&gt;Oops..wrong function used. Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 19:27:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215662#M63217</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-06-22T19:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and filter based on values matched in an eval case statement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215663#M63218</link>
      <description>&lt;P&gt;thanks for the help, that did the trick!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 21:31:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-filter-based-on-values-matched-in-an-eval-case/m-p/215663#M63218</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2016-06-22T21:31:13Z</dc:date>
    </item>
  </channel>
</rss>

