<?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: Search for mutiple values using rex and store them in a same single field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130154#M35427</link>
    <description>&lt;P&gt;You can combine the two regular expressions by OR'ing the prefixes using the pipe symbol: access-lists+|access-groups+&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2013 10:27:48 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-11-06T10:27:48Z</dc:date>
    <item>
      <title>Search for mutiple values using rex and store them in a same single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130153#M35426</link>
      <description>&lt;P&gt;Im looking to achieve the following using Rex.&lt;/P&gt;

&lt;P&gt;Below is the search query which im trying to run&lt;/P&gt;

&lt;P&gt;sourcetype=XXXXXX (-1XXXXX OR -1XXXXX) | rex "access-list\s+(?&lt;ACCESS&gt;[a-zA-Z0-9.&lt;EM&gt;-]+)" | rex "access-group\s+\"?(?&lt;ACCESS&gt;[A-Za-z.-&lt;/ACCESS&gt;&lt;/EM&gt;]+)\"?"&lt;/ACCESS&gt;&lt;/P&gt;

&lt;P&gt;rex "access-list\s+(?&lt;ACCESS&gt;[a-zA-Z0-9._-]+)"&lt;/ACCESS&gt;&lt;/P&gt;

&lt;P&gt;rex "access-group\s+\"?(?&lt;ACCESS&gt;[A-Za-z.-_]+)\"?"&lt;/ACCESS&gt;&lt;/P&gt;

&lt;P&gt;I know that i can store these results in two different variables.&lt;/P&gt;

&lt;P&gt;But i want to combine them into a single rex and store the output of these two rex into a single variable "Access" itself.&lt;/P&gt;

&lt;P&gt;Please let me know on how to achieve this functionality?&lt;/P&gt;

&lt;P&gt;Please share your thoughts on this.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2013 09:59:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130153#M35426</guid>
      <dc:creator>ppurokit</dc:creator>
      <dc:date>2013-11-06T09:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search for mutiple values using rex and store them in a same single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130154#M35427</link>
      <description>&lt;P&gt;You can combine the two regular expressions by OR'ing the prefixes using the pipe symbol: access-lists+|access-groups+&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2013 10:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130154#M35427</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-11-06T10:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Search for mutiple values using rex and store them in a same single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130155#M35428</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Tried the following and i dont see the "access" variable getting generated by the regex&lt;/P&gt;

&lt;P&gt;sourcetype=XXXXXX (-1XXXXX OR -1XXXXX) | rex "(access-list|access-group)\s"?(?&lt;ACCESS&gt;[A-Za-z.-0-9]+)"?"&lt;/ACCESS&gt;&lt;/P&gt;

&lt;P&gt;Im getting an splunk error  "Unknown search command 'a'."&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2013 11:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130155#M35428</guid>
      <dc:creator>ppurokit</dc:creator>
      <dc:date>2013-11-06T11:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search for mutiple values using rex and store them in a same single field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130156#M35429</link>
      <description>&lt;P&gt;Make sure there were no \d, \s, etc. lost in the formatting of splunkbase.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2013 11:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-mutiple-values-using-rex-and-store-them-in-a-same/m-p/130156#M35429</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-11-06T11:06:38Z</dc:date>
    </item>
  </channel>
</rss>

