<?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: Using regex in Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90306#M23198</link>
    <description>&lt;P&gt;Thank you @ranjyotiprakash. With a slight modification, I was able to get it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..... | rex field = _raw ".*\s+msg:\s+(?&lt;FIELD1&gt;\S+)\((?&lt;FIELD2&gt;\S+)\)-(?&lt;FIELD3&gt;.*)" | table field1, field2, field3&lt;/FIELD3&gt;&lt;/FIELD2&gt;&lt;/FIELD1&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 11 Jul 2013 04:22:14 GMT</pubDate>
    <dc:creator>darpohsh</dc:creator>
    <dc:date>2013-07-11T04:22:14Z</dc:date>
    <item>
      <title>Using regex in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90304#M23196</link>
      <description>&lt;P&gt;I would like to be able to extract some details from the logs, namely "AR1" and "SIN" as 2 fields and a 3rd field with the status after the text 'AR1(SIN)-'.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;# print: msg: AR1(SIN)-rollout: Group 1 started (06:25:51)&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;EM&gt;# print: msg: AR1(SIN)-rollout: Group 1 completed (06:41:08)&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Any advise on what is the regex that I should use in my Splunk query?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2013 04:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90304#M23196</guid>
      <dc:creator>darpohsh</dc:creator>
      <dc:date>2013-07-10T04:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90305#M23197</link>
      <description>&lt;P&gt;you have two options : &lt;/P&gt;

&lt;P&gt;1 .either perform field extraction using configurations in inputs.conf, props.conf, transforms.conf  &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/admin/Aboutconfigurationfiles"&gt;link text&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;or option 2. do field extraction directly in search command using rex &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Rex"&gt;link text&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;if using rex command, you can use something like this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..... | rex field = _raw ".*\s+msg:\s+(?&amp;lt;field1&amp;gt;\S+)\s+((?&amp;lt;field2&amp;gt;\S+))-(?&amp;lt;field3&amp;gt;.*)" | table field1, field2, field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..... | rex field = _raw ".*\s+msg:\s+(?&amp;lt;field1&amp;gt;\S+)\s+((?&amp;lt;field2&amp;gt;\S+))-(?&amp;lt;field3&amp;gt;.*)" | your search query
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2013 06:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90305#M23197</guid>
      <dc:creator>ranjyotiprakash</dc:creator>
      <dc:date>2013-07-10T06:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90306#M23198</link>
      <description>&lt;P&gt;Thank you @ranjyotiprakash. With a slight modification, I was able to get it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..... | rex field = _raw ".*\s+msg:\s+(?&lt;FIELD1&gt;\S+)\((?&lt;FIELD2&gt;\S+)\)-(?&lt;FIELD3&gt;.*)" | table field1, field2, field3&lt;/FIELD3&gt;&lt;/FIELD2&gt;&lt;/FIELD1&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jul 2013 04:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90306#M23198</guid>
      <dc:creator>darpohsh</dc:creator>
      <dc:date>2013-07-11T04:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using regex in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90307#M23199</link>
      <description>&lt;P&gt;yes .. i missed escaping the extra parenthesis. thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2013 13:52:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-regex-in-Splunk/m-p/90307#M23199</guid>
      <dc:creator>ranjyotiprakash</dc:creator>
      <dc:date>2013-07-12T13:52:45Z</dc:date>
    </item>
  </channel>
</rss>

