<?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 rex extraction of multiple fields from a record in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14335#M1514</link>
    <description>&lt;P&gt;While the following extraction below works, I wanted to see if I could extract both custom fields EAR_FILE and DOMAIN_NAME in one rex step instead of initiating a second search and rex command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Initiating redeploy*.ear" | rex field=_raw "(?&amp;lt;EAR_FILE&amp;gt;\w*\.ear)" | search "Initiating redeploy*.ear"| rex field=_raw "(?&amp;lt;DOMAIN_NAME&amp;gt;\w\wdomain\d\d)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Records:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;May 01, 2010 9:38:10 AM CDT&amp;gt; &amp;lt;Info&amp;gt; &amp;lt;J2EE Deployment SPI&amp;gt; &amp;lt;BEA-260121&amp;gt; &amp;lt;Initiating redeploy operation for application, MyApp [archive: /tmp/tsdomain01/upload/MyApp.ear], to configured targets.&amp;gt; 
&amp;lt;May 01, 2010 9:50:01 AM CDT&amp;gt; &amp;lt;Info&amp;gt; &amp;lt;J2EE Deployment SPI&amp;gt; &amp;lt;BEA-260121&amp;gt; &amp;lt;Initiating redeploy operation for application, YourApp [archive: /tmp/tsdomain02/upload/YourApp.ear], to configured targets.&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Rob&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2010 01:47:31 GMT</pubDate>
    <dc:creator>Rob_Jordan</dc:creator>
    <dc:date>2010-05-27T01:47:31Z</dc:date>
    <item>
      <title>rex extraction of multiple fields from a record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14335#M1514</link>
      <description>&lt;P&gt;While the following extraction below works, I wanted to see if I could extract both custom fields EAR_FILE and DOMAIN_NAME in one rex step instead of initiating a second search and rex command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Initiating redeploy*.ear" | rex field=_raw "(?&amp;lt;EAR_FILE&amp;gt;\w*\.ear)" | search "Initiating redeploy*.ear"| rex field=_raw "(?&amp;lt;DOMAIN_NAME&amp;gt;\w\wdomain\d\d)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample Records:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;May 01, 2010 9:38:10 AM CDT&amp;gt; &amp;lt;Info&amp;gt; &amp;lt;J2EE Deployment SPI&amp;gt; &amp;lt;BEA-260121&amp;gt; &amp;lt;Initiating redeploy operation for application, MyApp [archive: /tmp/tsdomain01/upload/MyApp.ear], to configured targets.&amp;gt; 
&amp;lt;May 01, 2010 9:50:01 AM CDT&amp;gt; &amp;lt;Info&amp;gt; &amp;lt;J2EE Deployment SPI&amp;gt; &amp;lt;BEA-260121&amp;gt; &amp;lt;Initiating redeploy operation for application, YourApp [archive: /tmp/tsdomain02/upload/YourApp.ear], to configured targets.&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 01:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14335#M1514</guid>
      <dc:creator>Rob_Jordan</dc:creator>
      <dc:date>2010-05-27T01:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: rex extraction of multiple fields from a record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14336#M1515</link>
      <description>&lt;P&gt;Without seeing the original event, it's hard to make a regex to pull both.  But, as a general rule, this is possible.  As an example, for the event "Green Eggs and Ham" you could do a regex similar to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "(?&amp;lt;egg_color&amp;gt;[^\s]+)[Ee]ggs and (?&amp;lt;meat_type&amp;gt;[^\s]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you're going to be doing this type of extraction on a regular basis, it might be worth it to read up on setting these up permanently in props.conf/transforms.conf.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2010 02:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14336#M1515</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-05-27T02:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: rex extraction of multiple fields from a record</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14337#M1516</link>
      <description>&lt;P&gt;dwaddle, thanks for the help. Based on your example above, I was able to get it to work with the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Initiating redeploy*.ear" | rex field=_raw "(?&amp;lt;DOMAIN_NAME&amp;gt;\w\wdomain\d\d)/.*/(?&amp;lt;EAR_FILE&amp;gt;\w*\.ear)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 May 2010 02:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extraction-of-multiple-fields-from-a-record/m-p/14337#M1516</guid>
      <dc:creator>Rob_Jordan</dc:creator>
      <dc:date>2010-05-27T02:55:24Z</dc:date>
    </item>
  </channel>
</rss>

