<?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: Regex - Search for Number Range within Array/String in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212385#M62188</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try with this:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
| rex "&lt;/CODE&gt;Event1&lt;CODE&gt;,(?P[0-9]+).*&lt;/CODE&gt;Event2&lt;CODE&gt;,(?P[0-9]+).*&lt;/CODE&gt;Event3&lt;CODE&gt;,(?P[0-9]+)"&lt;BR /&gt;
| search Event2 &amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Besides, you should have a look on the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;Splunk built-in field extractor&lt;/A&gt; documentation. This feature allows you to simply extract fields thru the GUI, without any particular knowledge of regex. And here is a website to learn regex: &lt;A href="http://regexone.com/lesson"&gt;http://regexone.com/lesson&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Sat, 02 Jan 2016 09:21:32 GMT</pubDate>
    <dc:creator>sttang88</dc:creator>
    <dc:date>2016-01-02T09:21:32Z</dc:date>
    <item>
      <title>Regex - Search for Number Range within Array/String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212382#M62185</link>
      <description>&lt;P&gt;Sample Data:&lt;/P&gt;

&lt;P&gt;ID | [[&lt;CODE&gt;Event1&lt;/CODE&gt;,1435],[&lt;CODE&gt;Event2&lt;/CODE&gt;,78],[&lt;CODE&gt;Event3&lt;/CODE&gt;,142]] | etc.....&lt;/P&gt;

&lt;P&gt;I'm wanting to build a query which will display the ID and the entire field of event data where 'Event2' is greater than (x).&lt;/P&gt;

&lt;P&gt;I'm not overly familiar with regular expressions, so if anyone can point me in the right direction, I'd greatly appreciate it. As it, I'm searching for ([&lt;CODE&gt;Event2&lt;/CODE&gt;,1] OR [&lt;CODE&gt;Event2&lt;/CODE&gt;,2] OR [&lt;CODE&gt;Event2&lt;/CODE&gt;,3] . . .)&lt;/P&gt;

&lt;P&gt;I'm trying to optimize my search here, and have had one heck of a time trying to self-instruct myself regex.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 06:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212382#M62185</guid>
      <dc:creator>chburnett</dc:creator>
      <dc:date>2016-01-02T06:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regex - Search for Number Range within Array/String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212383#M62186</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Not sure if this is what you want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearch
| rex field=_raw "(?&amp;lt;id&amp;gt;\d+) \| (?&amp;lt;events_raw&amp;gt;[^\|]+) \|"
| rex field=events_raw max_match=0 "\,(?&amp;lt;events&amp;gt;\d+)\]"
| eval MyEvent=mvindex(events,1)
| where MyEvent &amp;gt; 50
| table id, events
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The regex above will extract all your events as a multifield and then you can use the mv commands to filter when Event X is greater than any given value.&lt;/P&gt;

&lt;P&gt;Hope that helps.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 09:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212383#M62186</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-02T09:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regex - Search for Number Range within Array/String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212384#M62187</link>
      <description>&lt;P&gt;In case you want to try this out first: &lt;BR /&gt;
&lt;A href="https://regex101.com/r/eC1bI0/1"&gt;https://regex101.com/r/eC1bI0/1&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://regex101.com/r/qP4mY9/1"&gt;https://regex101.com/r/qP4mY9/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 09:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212384#M62187</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-01-02T09:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regex - Search for Number Range within Array/String</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212385#M62188</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try with this:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
| rex "&lt;/CODE&gt;Event1&lt;CODE&gt;,(?P[0-9]+).*&lt;/CODE&gt;Event2&lt;CODE&gt;,(?P[0-9]+).*&lt;/CODE&gt;Event3&lt;CODE&gt;,(?P[0-9]+)"&lt;BR /&gt;
| search Event2 &amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Besides, you should have a look on the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;Splunk built-in field extractor&lt;/A&gt; documentation. This feature allows you to simply extract fields thru the GUI, without any particular knowledge of regex. And here is a website to learn regex: &lt;A href="http://regexone.com/lesson"&gt;http://regexone.com/lesson&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 09:21:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Search-for-Number-Range-within-Array-String/m-p/212385#M62188</guid>
      <dc:creator>sttang88</dc:creator>
      <dc:date>2016-01-02T09:21:32Z</dc:date>
    </item>
  </channel>
</rss>

