<?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: rex pattern to create  a field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390446#M113722</link>
    <description>&lt;P&gt;the whole string looks like this&lt;/P&gt;

&lt;P&gt;I 2019-05-23 22:27:15.886Z 5960 1712 &lt;STRONG&gt;XOceMpk7Ph@Lna20eJwxXwAAAAU&lt;/STRONG&gt; 1@43465473@A WPB-Log: file=/users/source/testr.cls method=testmethod ID= ok=1 ProcessedBankTxnCount=2 TxnRecord=289 NumOfProcessedTxns=1&lt;/P&gt;

&lt;P&gt;I am using&lt;BR /&gt;
 rex field=rawdata "^\d+\s(?[^\s]*)\s" | table myField &lt;/P&gt;

&lt;P&gt;but it does not match anything.&lt;/P&gt;

&lt;P&gt;Am I missing anything?&lt;/P&gt;</description>
    <pubDate>Fri, 24 May 2019 16:59:11 GMT</pubDate>
    <dc:creator>iamtrying</dc:creator>
    <dc:date>2019-05-24T16:59:11Z</dc:date>
    <item>
      <title>rex pattern to create  a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390443#M113719</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have this string in the log.&lt;/P&gt;

&lt;P&gt;439 &lt;STRONG&gt;XObk5g6CUI62-gr3UIKfXAAAAAs&lt;/STRONG&gt; 1@43465473@A&lt;/P&gt;

&lt;P&gt;and I want to create a field out the string in the bold.&lt;/P&gt;

&lt;P&gt;Please mind that  &lt;STRONG&gt;439&lt;/STRONG&gt; and &lt;STRONG&gt;1@43465473@A&lt;/STRONG&gt; are not constant.&lt;/P&gt;

&lt;P&gt;Thanks for the help!&lt;/P&gt;

&lt;P&gt;Saurabh&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 23:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390443#M113719</guid>
      <dc:creator>iamtrying</dc:creator>
      <dc:date>2019-05-23T23:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: rex pattern to create  a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390444#M113720</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | fields - _time | eval rawdata="439 XObk5g6CUI62-gr3UIKfXAAAAAs 1@43465473@A" | rex field=rawdata "^\d+\s(?&amp;lt;myField&amp;gt;[^\s]*)\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More general regex would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | fields - _time | eval rawdata="439 XObk5g6CUI62-gr3UIKfXAAAAAs 1@43465473@A" | rex field=rawdata "^.*?\s(?&amp;lt;myField&amp;gt;[^\s]*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2019 00:09:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390444#M113720</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-05-24T00:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: rex pattern to create  a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390445#M113721</link>
      <description>&lt;P&gt;Hi @iamtrying&lt;/P&gt;

&lt;P&gt;Try this also&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval msg="439 XObk5g6CUI62-gr3UIKfXAAAAAs 1@43465473@A", result = mvindex(split(msg," "),1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 May 2019 06:31:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390445#M113721</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-05-24T06:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: rex pattern to create  a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390446#M113722</link>
      <description>&lt;P&gt;the whole string looks like this&lt;/P&gt;

&lt;P&gt;I 2019-05-23 22:27:15.886Z 5960 1712 &lt;STRONG&gt;XOceMpk7Ph@Lna20eJwxXwAAAAU&lt;/STRONG&gt; 1@43465473@A WPB-Log: file=/users/source/testr.cls method=testmethod ID= ok=1 ProcessedBankTxnCount=2 TxnRecord=289 NumOfProcessedTxns=1&lt;/P&gt;

&lt;P&gt;I am using&lt;BR /&gt;
 rex field=rawdata "^\d+\s(?[^\s]*)\s" | table myField &lt;/P&gt;

&lt;P&gt;but it does not match anything.&lt;/P&gt;

&lt;P&gt;Am I missing anything?&lt;/P&gt;</description>
      <pubDate>Fri, 24 May 2019 16:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390446#M113722</guid>
      <dc:creator>iamtrying</dc:creator>
      <dc:date>2019-05-24T16:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: rex pattern to create  a field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390447#M113723</link>
      <description>&lt;P&gt;You need to skip time stamp and then few other fields:&lt;/P&gt;

&lt;P&gt;Use this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | fields - _time | eval rawdata="I 2019-05-23 22:27:15.886Z 5960 1712 XOceMpk7Ph@Lna20eJwxXwAAAAU 1@43465473@A WPB-Log: file=/users/source/testr.cls method=testmethod ID= ok=1 ProcessedBankTxnCount=2 TxnRecord=289 NumOfProcessedTxns=1" | rex field=rawdata ".*?\s.*?\s.*?\s.*?\s.*?\s(?&amp;lt;myField&amp;gt;[^\s]*)" | table myField
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 May 2019 08:47:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-pattern-to-create-a-field/m-p/390447#M113723</guid>
      <dc:creator>nabeel652</dc:creator>
      <dc:date>2019-05-26T08:47:05Z</dc:date>
    </item>
  </channel>
</rss>

