<?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 How to filter a multivalue field using a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/591997#M206071</link>
    <description>&lt;P&gt;I found a close answer to what I'm looking for here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Why-cant-i-supply-a-field-as-value-for-mvfilter/m-p/450564/highlight/true#M127583" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Why-cant-i-supply-a-field-as-value-for-mvfilter/m-p/450564/highlight/true#M127583&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The example, excludes 1 example, add \"a\" for more, which works:&lt;/P&gt;&lt;PRE&gt;| makeresults 
| eval mymvfield ="a b c" 
| makemv mymvfield 
| eval excludes = mvfilter(NOT in(mymvfield, 
    [| makeresults 
    | eval search = "\"b\"" 
    | return $search]))&lt;/PRE&gt;&lt;P&gt;What I'm looking for, use return which seemingly translates to (b) OR (a) ... :&lt;/P&gt;&lt;PRE&gt;| makeresults 
| eval mymvfield ="a b c" 
| makemv mymvfield 
| eval excludes = mvfilter(NOT in(mymvfield, 
    [| search something
    | return 3 $some_field]))&lt;/PRE&gt;&lt;P&gt;I get weird parsing errors which I thought maybe could be solved by using "format" but I'm at a loss.&lt;/P&gt;&lt;P&gt;I reckon you could probably solve this by doing a subsearch and filtering prior to making the multivalue field, I'm however curious if you can make this query work.&lt;/P&gt;&lt;P&gt;Please let me know if anything is unclear.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Apr 2022 18:47:50 GMT</pubDate>
    <dc:creator>chrids</dc:creator>
    <dc:date>2022-04-01T18:47:50Z</dc:date>
    <item>
      <title>How to filter a multivalue field using a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/591997#M206071</link>
      <description>&lt;P&gt;I found a close answer to what I'm looking for here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Why-cant-i-supply-a-field-as-value-for-mvfilter/m-p/450564/highlight/true#M127583" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Why-cant-i-supply-a-field-as-value-for-mvfilter/m-p/450564/highlight/true#M127583&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The example, excludes 1 example, add \"a\" for more, which works:&lt;/P&gt;&lt;PRE&gt;| makeresults 
| eval mymvfield ="a b c" 
| makemv mymvfield 
| eval excludes = mvfilter(NOT in(mymvfield, 
    [| makeresults 
    | eval search = "\"b\"" 
    | return $search]))&lt;/PRE&gt;&lt;P&gt;What I'm looking for, use return which seemingly translates to (b) OR (a) ... :&lt;/P&gt;&lt;PRE&gt;| makeresults 
| eval mymvfield ="a b c" 
| makemv mymvfield 
| eval excludes = mvfilter(NOT in(mymvfield, 
    [| search something
    | return 3 $some_field]))&lt;/PRE&gt;&lt;P&gt;I get weird parsing errors which I thought maybe could be solved by using "format" but I'm at a loss.&lt;/P&gt;&lt;P&gt;I reckon you could probably solve this by doing a subsearch and filtering prior to making the multivalue field, I'm however curious if you can make this query work.&lt;/P&gt;&lt;P&gt;Please let me know if anything is unclear.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 18:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/591997#M206071</guid>
      <dc:creator>chrids</dc:creator>
      <dc:date>2022-04-01T18:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field using a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592048#M206097</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval mymvfield ="a b c" 
| makemv mymvfield 
| eval excludes = mvfilter(NOT  
    [| makeresults 
    | eval mymvfield = "b" 
    | append
        [| makeresults
        | eval mymvfield = "c"]
    | format "" "" "" "" "AND" ""])&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 02 Apr 2022 08:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592048#M206097</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-02T08:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field using a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592123#M206120</link>
      <description>&lt;P&gt;It's almost there, I can't manage to replace the two "| makeresults/| append" with a "| search" however in the final query.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval mymvfield = "b" 
| append
   [| makeresults
    | eval mymvfield = "c"]
    | format "" "" "" "" "AND" ""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;evaluates to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;mymvfield="b"  AND  mymvfield="c"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;My reduced use-case:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| append [
   | search foo
   | fields bar
   | head 2]
| format "" "" "" "" "AND" ""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;evaluates to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;bar="result1"  AND  bar="result2"  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wrapping that into mvfilter(NOT [ .. ]) gives me:&amp;nbsp;Error in 'eval' command: The expression is malformed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 04:41:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592123#M206120</guid>
      <dc:creator>chrids</dc:creator>
      <dc:date>2022-04-04T04:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field using a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592139#M206125</link>
      <description>&lt;P&gt;Please share your actual search to determine what might be amiss&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 07:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592139#M206125</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-04T07:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a multivalue field using a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592175#M206129</link>
      <description>&lt;P&gt;Got it working! Thanks so much!&lt;BR /&gt;&lt;BR /&gt;I had a syntax error and changed it to a final:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval bar_filtered = mvfilter(NOT 
  [ 
    | makeresults
    | append 
      [
        | search foo
        | rename foobar as bar
        | fields bar
      ]
    | format "(" "" "" "" "OR" ")"
  ]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 10:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-multivalue-field-using-a-subsearch/m-p/592175#M206129</guid>
      <dc:creator>chrids</dc:creator>
      <dc:date>2022-04-04T10:14:02Z</dc:date>
    </item>
  </channel>
</rss>

