<?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 Regular Expression (RegEX) Extracting Field from String Contains in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197676#M57118</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to extract the third comma deliminated column with the string "ABC" in it.&lt;/P&gt;

&lt;P&gt;example data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;QWE ALL,06/12/2014 15:36:14,0.9678687876
QW,06/12/2014 15:36:12,0.5645564664
ERM,06/12/2014 15:36:11,0.3424234242
MJK,06/12/2014 15:36:10,0.2342344342
ABC PLD01234; THIS IS TEST MESSAGE FROM PLD01234 FOR MACHINE ABB231,06/12/2014 15:36:09,0.654354326
ABC PLDS; THIS IS TEST ,06/12/2014 15:36:07,3.564647835
FGH FG456,06/12/2014 15:36:06,0.543574354
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need the expression to extract 0.654354326 and 3.564647835.&lt;/P&gt;

&lt;P&gt;I was trying &lt;CODE&gt;(^|)ABC |$)[^ \n]* \d+:\d+:\d+,(?P&amp;lt;FIELDNAME&amp;gt;.+)&lt;/CODE&gt; but have not had any luck. Any ideas?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jun 2014 20:54:04 GMT</pubDate>
    <dc:creator>nissanse98</dc:creator>
    <dc:date>2014-06-12T20:54:04Z</dc:date>
    <item>
      <title>Regular Expression (RegEX) Extracting Field from String Contains</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197676#M57118</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to extract the third comma deliminated column with the string "ABC" in it.&lt;/P&gt;

&lt;P&gt;example data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;QWE ALL,06/12/2014 15:36:14,0.9678687876
QW,06/12/2014 15:36:12,0.5645564664
ERM,06/12/2014 15:36:11,0.3424234242
MJK,06/12/2014 15:36:10,0.2342344342
ABC PLD01234; THIS IS TEST MESSAGE FROM PLD01234 FOR MACHINE ABB231,06/12/2014 15:36:09,0.654354326
ABC PLDS; THIS IS TEST ,06/12/2014 15:36:07,3.564647835
FGH FG456,06/12/2014 15:36:06,0.543574354
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need the expression to extract 0.654354326 and 3.564647835.&lt;/P&gt;

&lt;P&gt;I was trying &lt;CODE&gt;(^|)ABC |$)[^ \n]* \d+:\d+:\d+,(?P&amp;lt;FIELDNAME&amp;gt;.+)&lt;/CODE&gt; but have not had any luck. Any ideas?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 20:54:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197676#M57118</guid>
      <dc:creator>nissanse98</dc:creator>
      <dc:date>2014-06-12T20:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression (RegEX) Extracting Field from String Contains</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197677#M57119</link>
      <description>&lt;P&gt;You could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.*?\,.*?\,(?P&amp;lt;FIELDNAME&amp;gt;\d+\.\d+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I think it would work&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2014 21:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197677#M57119</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-06-12T21:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression (RegEX) Extracting Field from String Contains</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197678#M57120</link>
      <description>&lt;P&gt;Hi lguinn,&lt;/P&gt;

&lt;P&gt;Thank you for your response; that helped me out a lot! However, the data I'm attempting to parse has some complications. There are additional fields to the example data above. I need a string that can determine difference between:&lt;/P&gt;

&lt;P&gt;S,date,0.2343432&lt;BR /&gt;
S #random words,date,0.3423423&lt;BR /&gt;
SRS,date,0.4353453&lt;BR /&gt;
SRS #random words,date,0.453453&lt;BR /&gt;
 I need an expression that gather the string that starts with "S," OR "S " (space)&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jun 2014 16:04:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197678#M57120</guid>
      <dc:creator>nissanse98</dc:creator>
      <dc:date>2014-06-14T16:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression (RegEX) Extracting Field from String Contains</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197679#M57121</link>
      <description>&lt;P&gt;This works for S with space&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(^S ).*?\,.*?\,(?P&amp;lt;FIELDNAME&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This works for S with comma&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(^S,).*?\,(?P&amp;lt;FIELDNAME&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Attempts to combine the expression......&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;((^S ).*?\,.*?\,)|((^S,).*?\,)(?P&amp;lt;FIELDNAME&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Returns: AttributeError: 'NoneType' object has no attribute 'replace'&lt;/P&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;((^S ).*?\,.*?\,)(?P&amp;lt;FIELDNAME&amp;gt;.+)|((^S,).*?\,)(?P&amp;lt;FIELDNAME&amp;gt;.+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Returns:Invalid regex: redefinition of group name u'FIELDNAME' as group 6; was group 3&lt;/P&gt;

&lt;P&gt;I feel I'm close but am missing something. Appreciate any help! Thank you! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jun 2014 16:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197679#M57121</guid>
      <dc:creator>nissanse98</dc:creator>
      <dc:date>2014-06-14T16:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression (RegEX) Extracting Field from String Contains</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197680#M57122</link>
      <description>&lt;P&gt;You can have multiple REGEXes for the same field - Splunk does not require that you combine them. Just do this in &lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
EXTRACT-e1 = (^S ).*?\,.*?\,(?P&amp;lt;myfield&amp;gt;.+)
EXTRACT-e2 = (^S,).*?\,(?P&amp;lt;myfield&amp;gt;.+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice that both lines have the &lt;EM&gt;same&lt;/EM&gt; field name. You could add a third if you want, etc.&lt;/P&gt;

&lt;P&gt;I would probably put this in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/local/props.conf&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jun 2014 16:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197680#M57122</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-06-14T16:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regular Expression (RegEX) Extracting Field from String Contains</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197681#M57123</link>
      <description>&lt;P&gt;Thanks! That helps out a lot!&lt;/P&gt;

&lt;P&gt;I had to use the props.conf in this directory to work:&lt;BR /&gt;
\etc\users\admin\"appname"\local&lt;/P&gt;

&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Sat, 14 Jun 2014 19:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regular-Expression-RegEX-Extracting-Field-from-String-Contains/m-p/197681#M57123</guid>
      <dc:creator>nissanse98</dc:creator>
      <dc:date>2014-06-14T19:19:51Z</dc:date>
    </item>
  </channel>
</rss>

