<?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: Help with writing Regex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194503#M56065</link>
    <description>&lt;P&gt;The rex command will extract the fields for you.  That is what the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;x&amp;gt;*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;construct does.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Aug 2015 12:30:26 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2015-08-27T12:30:26Z</dc:date>
    <item>
      <title>Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194499#M56061</link>
      <description>&lt;P&gt;Can someone please help me to write a regex to get the value "78"  value from the below sample data?&lt;/P&gt;

&lt;P&gt;Destination to Source positive jitter Number/Sum/Sum2: 76/78/80&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 17:57:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194499#M56061</guid>
      <dc:creator>Ganees</dc:creator>
      <dc:date>2015-08-26T17:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194500#M56062</link>
      <description>&lt;P&gt;Something like - &lt;CODE&gt;| rex "(?\d\d)/(?\d\d)/(?\d\d)"&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 19:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194500#M56062</guid>
      <dc:creator>danny2015</dc:creator>
      <dc:date>2015-08-26T19:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194501#M56063</link>
      <description>&lt;P&gt;You'll probably want some field names to use downstream&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "(?&amp;lt;Number&amp;gt;\d\d)\/(?&amp;lt;Sum&amp;gt;\d\d)\/(?&amp;lt;Sum2&amp;gt;\d\d)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Perhaps the editor stripped them from @Ganees' answer.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 19:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194501#M56063</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-26T19:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194502#M56064</link>
      <description>&lt;P&gt;Thanks for your help. Do you mean that I need to have the field extracted before doing the search?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 12:11:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194502#M56064</guid>
      <dc:creator>Ganees</dc:creator>
      <dc:date>2015-08-27T12:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194503#M56065</link>
      <description>&lt;P&gt;The rex command will extract the fields for you.  That is what the &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;x&amp;gt;*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;construct does.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 12:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194503#M56065</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-27T12:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194504#M56066</link>
      <description>&lt;P&gt;Every minute the file gets updated with new values as you can see below&lt;/P&gt;

&lt;P&gt;index="new_tor" "Destination to Source negative jitter Number/Sum/Sum2" This returns the below results&lt;/P&gt;

&lt;P&gt;8/27/15 8:54:15.512 AM Destination to Source negative jitter Number/Sum/Sum2: 103/106/112&lt;BR /&gt;
8/27/15 8:53:15.496 AM Destination to Source negative jitter Number/Sum/Sum2: 199/206/220&lt;BR /&gt;
8/27/15 8:52:15.496 AM Destination to Source negative jitter Number/Sum/Sum2: 108/109/111&lt;/P&gt;

&lt;P&gt;Now I want to make a timechart for Sum, so my search query is &lt;/P&gt;

&lt;P&gt;index="new_tor" "Destination to Source negative jitter Number/Sum/Sum2" | rex "(?\d\d)\/(?\d\d)\/(?\d\d)" | timechart span=1min values(Sum) as Jitter-Sum | sort - _time | head 10&lt;/P&gt;

&lt;P&gt;And I  see below results. The values I would expect to see would be 106,206,109&lt;BR /&gt;
_time                                                  Jitter-Sum&lt;BR /&gt;
2015-08-27 08:54:15&lt;BR /&gt;&lt;BR /&gt;
2015-08-27 08:53:15                            75&lt;BR /&gt;
2015-08-27 08:52:15                          59&lt;/P&gt;

&lt;P&gt;Any idea where I am making mistake?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 13:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194504#M56066</guid>
      <dc:creator>Ganees</dc:creator>
      <dc:date>2015-08-27T13:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing Regex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194505#M56067</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="new_tor" "Destination to Source negative jitter Number/Sum/Sum2" | rex "Number/Sum/Sum2:\s+(?&amp;lt;Number&amp;gt;\d+)\/(?&amp;lt;Sum&amp;gt;\d+)\/(?&amp;lt;Sum2&amp;gt;\d+)" | timechart span=1min values(Sum) as Jitter-Sum | sort - _time | head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What should happen is the rex command creates the field "Number" and assigns it the value of whatever numbers it finds (hence the &lt;CODE&gt;\d+&lt;/CODE&gt;) before the next forward slash. It does the same thing with Sum and Sum2.&lt;/P&gt;

&lt;P&gt;Here's some good documentation on regex:&lt;BR /&gt;
&lt;A href="http://www.rexegg.com/regex-quickstart.html"&gt;http://www.rexegg.com/regex-quickstart.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also a cool app you can use for practicing and testing your regex:&lt;BR /&gt;
&lt;A href="http://www.regexr.com/"&gt;http://www.regexr.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 13:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-writing-Regex/m-p/194505#M56067</guid>
      <dc:creator>PGrantham</dc:creator>
      <dc:date>2015-08-27T13:52:45Z</dc:date>
    </item>
  </channel>
</rss>

