<?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: Filter multivalue field based on regex generated by subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-multivalue-field-based-on-regex-generated-by-subsearch/m-p/240132#M71371</link>
    <description>&lt;P&gt;This should do the trick: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main sourcetype=mobile_catalog_events event_name=impression
 | eval relevant_ids=  [ inputlookup my_lookup| table id| rename id as game_ids | mvcombine  delim="|" game_ids | nomv game_ids | eval game_ids="\"".game_ids."\"" | return $game_ids]
 | where match(game_ids,relevant_ids) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 25 Sep 2015 20:01:15 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-09-25T20:01:15Z</dc:date>
    <item>
      <title>Filter multivalue field based on regex generated by subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-multivalue-field-based-on-regex-generated-by-subsearch/m-p/240131#M71370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have "impression" events for a mobile page that has many games on it, and they have 1 field called "game_ids" which is a comma delimited list of id's of the relevant games. I also have a lookup table which holds a small number of games which i'm particularly interested in. &lt;/P&gt;

&lt;P&gt;Because the number of impression events is very large, and there can be dozens of games in each impression, I want to filter these events before I use MVEXPAND.&lt;/P&gt;

&lt;P&gt;Took me a bit, but I came up with the following solution - subsearch the lookup into a regex string literal, then use it to filter the events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=mobile_catalog_events event_name=impression
| eval relevant_ids=  [ inputlookup my_lookup| table id| rename id as game_ids | mvcombine  delim="|" game_ids | nomv game_ids | eval game_ids="\"".game_ids."\"" | return $game_ids]
| regex game_ids=relevant_ids
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, the search returns no results. The subsearch is verified to work. I also took a sample of game_ids, and ran them through an external online REGEX tool, and the regex works.&lt;/P&gt;

&lt;P&gt;Any assistance would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2015 15:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-multivalue-field-based-on-regex-generated-by-subsearch/m-p/240131#M71370</guid>
      <dc:creator>giladirim</dc:creator>
      <dc:date>2015-09-25T15:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Filter multivalue field based on regex generated by subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-multivalue-field-based-on-regex-generated-by-subsearch/m-p/240132#M71371</link>
      <description>&lt;P&gt;This should do the trick: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main sourcetype=mobile_catalog_events event_name=impression
 | eval relevant_ids=  [ inputlookup my_lookup| table id| rename id as game_ids | mvcombine  delim="|" game_ids | nomv game_ids | eval game_ids="\"".game_ids."\"" | return $game_ids]
 | where match(game_ids,relevant_ids) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Sep 2015 20:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-multivalue-field-based-on-regex-generated-by-subsearch/m-p/240132#M71371</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-25T20:01:15Z</dc:date>
    </item>
  </channel>
</rss>

