<?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 regex in lookup file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479859#M134486</link>
    <description>&lt;P&gt;I want to match a reg ex pattern (e.g. "aaa\s+:\d\d") from a lookup file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;pattern,output_value
"aaa\s+:\d\d:", 2
"aaa\s+:\d:", 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, whenever first pattern matches in the event, I should get value as 2. &lt;BR /&gt;
How can we do this?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2019 17:15:49 GMT</pubDate>
    <dc:creator>ankitarath2011</dc:creator>
    <dc:date>2019-09-11T17:15:49Z</dc:date>
    <item>
      <title>regex in lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479859#M134486</link>
      <description>&lt;P&gt;I want to match a reg ex pattern (e.g. "aaa\s+:\d\d") from a lookup file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;pattern,output_value
"aaa\s+:\d\d:", 2
"aaa\s+:\d:", 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, whenever first pattern matches in the event, I should get value as 2. &lt;BR /&gt;
How can we do this?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 17:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479859#M134486</guid>
      <dc:creator>ankitarath2011</dc:creator>
      <dc:date>2019-09-11T17:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: regex in lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479860#M134487</link>
      <description>&lt;P&gt;Build a subsearch to build the EVALs for you?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="aaa :4:" 
| eval 
    [| inputlookup test_regex.csv 
    | fields pattern output_value 
    | eval search="test=if(match(_raw,\"".pattern."\"),\"".output_value."\", test), " 
    | fields search 
    | mvcombine search 
    | eval search=trim(trim(mvjoin(search," "),"| eval"),", ")]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 15 Sep 2019 12:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479860#M134487</guid>
      <dc:creator>mhoogcarspel_sp</dc:creator>
      <dc:date>2019-09-15T12:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: regex in lookup file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479861#M134488</link>
      <description>&lt;P&gt;Hey getting below error&lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at ')'.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 07:45:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-in-lookup-file/m-p/479861#M134488</guid>
      <dc:creator>ankitarath2011</dc:creator>
      <dc:date>2019-09-16T07:45:31Z</dc:date>
    </item>
  </channel>
</rss>

