<?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 do I loop through a list of regular expression patterns stored in a KV store in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-loop-through-a-list-of-regular-expression-patterns/m-p/471234#M132576</link>
    <description>&lt;P&gt;I am new to Splunk. &lt;/P&gt;

&lt;P&gt;The  &lt;CODE&gt;cluster&lt;/CODE&gt; command gives me results that I am looking for and some. I would like to filter the results of this command with a list of regular expression patterns that I have stored in a KV store, but I am having a tough time getting the answers that I am looking for.  When I run the &lt;CODE&gt;map&lt;/CODE&gt; command below it looks like the  &lt;EM&gt;$payload$&lt;/EM&gt; ends up with the value rather than the field name.&lt;/P&gt;

&lt;P&gt;The  &lt;EM&gt;app_critical_warning&lt;/EM&gt; KV store has a list of regexp patterns with one of the column names being  &lt;EM&gt;regexp_pattern&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Here's the search that I have come up with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="someindex" msgtype::warning |
cluster t=0.9 showcount=true field=payload |
table cluster_count payload |
map [|inputlookup app_critical_warning |
regex $payload$=regexp_pattern ] maxsearches=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does anybody have any suggestions on how to go about this task?  I can compose the search with all the  &lt;CODE&gt;regex&lt;/CODE&gt; patterns, but I would like to maintain it in a KV store for logistic reasons.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 05:37:27 GMT</pubDate>
    <dc:creator>govardha</dc:creator>
    <dc:date>2020-09-30T05:37:27Z</dc:date>
    <item>
      <title>How do I loop through a list of regular expression patterns stored in a KV store in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-loop-through-a-list-of-regular-expression-patterns/m-p/471234#M132576</link>
      <description>&lt;P&gt;I am new to Splunk. &lt;/P&gt;

&lt;P&gt;The  &lt;CODE&gt;cluster&lt;/CODE&gt; command gives me results that I am looking for and some. I would like to filter the results of this command with a list of regular expression patterns that I have stored in a KV store, but I am having a tough time getting the answers that I am looking for.  When I run the &lt;CODE&gt;map&lt;/CODE&gt; command below it looks like the  &lt;EM&gt;$payload$&lt;/EM&gt; ends up with the value rather than the field name.&lt;/P&gt;

&lt;P&gt;The  &lt;EM&gt;app_critical_warning&lt;/EM&gt; KV store has a list of regexp patterns with one of the column names being  &lt;EM&gt;regexp_pattern&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;Here's the search that I have come up with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="someindex" msgtype::warning |
cluster t=0.9 showcount=true field=payload |
table cluster_count payload |
map [|inputlookup app_critical_warning |
regex $payload$=regexp_pattern ] maxsearches=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Does anybody have any suggestions on how to go about this task?  I can compose the search with all the  &lt;CODE&gt;regex&lt;/CODE&gt; patterns, but I would like to maintain it in a KV store for logistic reasons.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:37:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-loop-through-a-list-of-regular-expression-patterns/m-p/471234#M132576</guid>
      <dc:creator>govardha</dc:creator>
      <dc:date>2020-09-30T05:37:27Z</dc:date>
    </item>
  </channel>
</rss>

