<?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 use variable on mvfilter regex match? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690477#M235164</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your solution worked and you provided better example than Splunk documentation&lt;BR /&gt;I appreciate your help. Thanks&lt;BR /&gt;&lt;BR /&gt;I thought I used one field on my mvfilter, which is fullcode...&amp;nbsp; I guess partialcode is considered&amp;nbsp; the second field..&lt;/P&gt;&lt;PRE&gt;| eval fullcode2=mvfilter(match(fullcode,partialcode))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 14:10:02 GMT</pubDate>
    <dc:creator>LearningGuy</dc:creator>
    <dc:date>2024-06-12T14:10:02Z</dc:date>
    <item>
      <title>How to use variable on mvfilter regex match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690406#M235146</link>
      <description>&lt;P&gt;&lt;BR /&gt;If I used variable in the mvfilter match, i got the following error&lt;BR /&gt;&lt;SPAN&gt;Error in 'EvalCommand': The arguments to the 'mvfilter' function are invalid.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;If I replaced the partialcode with a string, it worked fine&lt;BR /&gt;Please help. Thank you so much&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval fullcode= "code-abc-1111,code-abc-2222,code-xyz-1111,code-xyz-222"
| eval partialcode="code-abc"
| makemv delim="," fullcode
| eval fullcode2=mvfilter(match(fullcode,partialcode))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;This one worked fine&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval fullcode= "code-abc-1111,code-abc-2222,code-xyz-1111,code-xyz-222"
| eval partialcode="code-abc"
| makemv delim="," fullcode
| eval fullcode2=mvfilter(match(fullcode,"code-abc"))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 03:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690406#M235146</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-06-12T03:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variable on mvfilter regex match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690411#M235150</link>
      <description>&lt;P&gt;mvfilter only takes a single field&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/MultivalueEvalFunctions#mvfilter.28.26lt.3Bpredicate.26gt.3B.29" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/MultivalueEvalFunctions#mvfilter.28.26lt.3Bpredicate.26gt.3B.29&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Use mvmap instead&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval fullcode= "code-abc-1111,code-abc-2222,code-xyz-1111,code-xyz-222"
| eval partialcode="code-abc"
| makemv delim="," fullcode
| eval fullcode2=mvmap(fullcode, if(match(fullcode,partialcode), fullcode, null()))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 04:31:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690411#M235150</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-06-12T04:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variable on mvfilter regex match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690477#M235164</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your solution worked and you provided better example than Splunk documentation&lt;BR /&gt;I appreciate your help. Thanks&lt;BR /&gt;&lt;BR /&gt;I thought I used one field on my mvfilter, which is fullcode...&amp;nbsp; I guess partialcode is considered&amp;nbsp; the second field..&lt;/P&gt;&lt;PRE&gt;| eval fullcode2=mvfilter(match(fullcode,partialcode))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 14:10:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690477#M235164</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2024-06-12T14:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variable on mvfilter regex match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690552#M235176</link>
      <description>&lt;P&gt;You are right, partialcode is the second field - mvfilter has a few use cases, but I've generally found I'm always wanting to relate it to some other field, so when mvmap came along in Splunk 8, I almost never use mvfilter now - even when I could.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-variable-on-mvfilter-regex-match/m-p/690552#M235176</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-06-12T21:39:53Z</dc:date>
    </item>
  </channel>
</rss>

