<?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: Extract multiple fields with one RegEx in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395533#M114850</link>
    <description>&lt;P&gt;Please provide a good set of example data (anonymized, but valid - only anonymize, don't change anything otherwise) that you also use the &lt;CODE&gt;101010&lt;/CODE&gt; button on to make it be formatted correctly and it doesn't remove any characters) along with your non-working regular expression (again using the &lt;CODE&gt;101010&lt;/CODE&gt; button for formatting). That will help tremendously in helping you.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jun 2018 00:06:03 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2018-06-19T00:06:03Z</dc:date>
    <item>
      <title>Extract multiple fields with one RegEx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395532#M114849</link>
      <description>&lt;P&gt;Splunkers,&lt;/P&gt;

&lt;P&gt;I'm trying to write one regex to extract a bunch of fields from a single event.  &lt;/P&gt;

&lt;P&gt;Here's an example of one event of some of the fields in one event:&lt;/P&gt;

&lt;P&gt;avgtemp 50 hottemp 50 tempalert y tempflag y etc&lt;/P&gt;

&lt;P&gt;I've tried using a pipe to separate the field extractions with no luck.&lt;/P&gt;

&lt;P&gt;When I run the preview in the Splunk field extractor, I get no results.  When I remove every capture group except the first one, it works just fine.&lt;/P&gt;

&lt;P&gt;Any advice with the regex would be great.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 23:36:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395532#M114849</guid>
      <dc:creator>matthew_foos</dc:creator>
      <dc:date>2018-06-18T23:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple fields with one RegEx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395533#M114850</link>
      <description>&lt;P&gt;Please provide a good set of example data (anonymized, but valid - only anonymize, don't change anything otherwise) that you also use the &lt;CODE&gt;101010&lt;/CODE&gt; button on to make it be formatted correctly and it doesn't remove any characters) along with your non-working regular expression (again using the &lt;CODE&gt;101010&lt;/CODE&gt; button for formatting). That will help tremendously in helping you.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 00:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395533#M114850</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-19T00:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple fields with one RegEx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395534#M114851</link>
      <description>&lt;P&gt;if your event is like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;avgtemp 50 hottemp 50 tempalert y tempflag y etc
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you can list each field :  try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch 
| rex "avgtemp (?&amp;lt;avgtemp&amp;gt;\d+) hottemp (?&amp;lt;hottemp&amp;gt;\d+) tempalert (?&amp;lt;tempalert)\w+) tempflag (?&amp;lt;tempflag&amp;gt;\d+)" " 
| table avgtemp hottemp tempalert tempflag
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or you can use a field transforms and define the field name dynamically.&lt;BR /&gt;
see transforms.conf&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Managefieldtransforms#Example_-_Extract_both_field_names_and_their_corresponding_field_values_from_an_event"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Managefieldtransforms#Example_-_Extract_both_field_names_and_their_corresponding_field_values_from_an_event&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;example on disk on the search-head.&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype]
TRANSFORMS-myextraction=repeat_regex_space_separator
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [repeat_regex_space_separator]
 REGEX = ([a-z])]\s(\d+)
 FORMAT = $1::$2
 REPEAT_MATCH = true
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jun 2018 00:44:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395534#M114851</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2018-06-19T00:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple fields with one RegEx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395535#M114852</link>
      <description>&lt;P&gt;I'm trying to do this in the field extractor.&lt;/P&gt;

&lt;P&gt;SourceSystem\s(?P\w+)(.*?)TargetSystem\s(?P\w+)&lt;/P&gt;

&lt;P&gt;Would the (.*?) work?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395535#M114852</guid>
      <dc:creator>matthew_foos</dc:creator>
      <dc:date>2018-06-20T16:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple fields with one RegEx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395536#M114853</link>
      <description>&lt;P&gt;What if this sequence is not in order:&lt;/P&gt;

&lt;P&gt;avgtemp 50 hottemp 50 tempalert y tempflag y etc&lt;/P&gt;

&lt;P&gt;avgtemp 50 tempalert y tempflag y etc hottemp 50 &lt;/P&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 11:05:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395536#M114853</guid>
      <dc:creator>AnilPujar</dc:creator>
      <dc:date>2018-10-14T11:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple fields with one RegEx</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395537#M114854</link>
      <description>&lt;P&gt;I think I would need some sample data but for the time being what comes before the regex can affect your results. &lt;/P&gt;

&lt;P&gt;|regex Event_Sample="1st field|2nd field"&lt;/P&gt;

&lt;P&gt;If you still could use an answer to this question just comment on this feed. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 03:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-fields-with-one-RegEx/m-p/395537#M114854</guid>
      <dc:creator>ryhluc01</dc:creator>
      <dc:date>2019-02-05T03:10:15Z</dc:date>
    </item>
  </channel>
</rss>

