<?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: How to use rex to extract the very next word in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387574#M113047</link>
    <description>&lt;P&gt;Hi Rajesh,&lt;/P&gt;

&lt;P&gt;I have tried what you have suggested, but seems like it did not worked out(No fields were extracted)&lt;BR /&gt;
Probably you can ingest my given few sample data and see if it works?&lt;BR /&gt;
Please let me know for any further questions.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ankit&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2018 15:37:25 GMT</pubDate>
    <dc:creator>Akumar294</dc:creator>
    <dc:date>2018-09-21T15:37:25Z</dc:date>
    <item>
      <title>How to use rex to extract the very next word in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387572#M113045</link>
      <description>&lt;P&gt;Good Day,&lt;/P&gt;

&lt;P&gt;I would like to extract a new field called "Status" and the values for this field will be the text right after "status changed to".&lt;BR /&gt;
For example - Completed, Waiting,Launched,Active.&lt;BR /&gt;
Is this regex good match?- (Completed|Launched|Active|Waiting), but how to write this in splunk so that it creates a new field called status?&lt;/P&gt;

&lt;P&gt;I have data in below form:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;310822856,"09/19/2018
02:31:30
PM","Job ""DMS_05_BosLog_Files [88]"" status change to Completed Normally.",Audit,Job Manager,1100,DMS_05_Outbound_Files,88,Production
310822857,"09/19/2018
02:31:30
PM","Job ""02_DMS_BSTORE [89]"" status change to Completed Normally.",Audit,Job Manager,1100,02_DMS_EOD_LOG_ZSTORE,89,
310822848,"09/19/2018
02:31:29
PM","Job ""DFMS_05__Outbound_Files [90]"" status change to Launched.",Audit,Job Manager,1100,DMS_05_Outbound_Files,90,Production
22855,"09/19/2018
02:31:29
PM","Job ""DMS_05_Archive_PosLog_Outbound_Files [91]"" status change to Active",Audit,Job Manager,1100,DMS_05_Outbound_Files,10317045,Production
22840,"09/19/2018
02:31:28
PM","Job ""DMS_05_Archive_PosLog_Outbound_Files [91]"" status change to Waiting On Resource",Audit,Job Manager,1100,DMS_05_Outbound_Files,7045,Production
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note : I am running splunk Cloud&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 04:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387572#M113045</guid>
      <dc:creator>Akumar294</dc:creator>
      <dc:date>2018-09-21T04:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract the very next word in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387573#M113046</link>
      <description>&lt;P&gt;Hi @Akumar,&lt;BR /&gt;
try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|rex  "status change to (?&amp;lt;status&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this will create new field status and store extracted value&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 12:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387573#M113046</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-09-21T12:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract the very next word in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387574#M113047</link>
      <description>&lt;P&gt;Hi Rajesh,&lt;/P&gt;

&lt;P&gt;I have tried what you have suggested, but seems like it did not worked out(No fields were extracted)&lt;BR /&gt;
Probably you can ingest my given few sample data and see if it works?&lt;BR /&gt;
Please let me know for any further questions.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Ankit&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 15:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387574#M113047</guid>
      <dc:creator>Akumar294</dc:creator>
      <dc:date>2018-09-21T15:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract the very next word in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387575#M113048</link>
      <description>&lt;P&gt;I tried below and its working for me-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval DB="310822856,\"09/19/2018
02:31:30
PM\",\"Job \"\"DMS_05_BosLog_Files [88]\"\" status change to Completed Normally.\",Audit,Job Manager,1100,DMS_05_Outbound_Files,88,Production
310822857,\"09/19/2018
02:31:30
PM\",\"Job \"\"02_DMS_BSTORE [89]\"\" status change to Completed Normally.\",Audit,Job Manager,1100,02_DMS_EOD_LOG_ZSTORE,89,
310822848,\"09/19/2018
02:31:29
PM\",\"Job \"\"DFMS_05__Outbound_Files [90]\"\" status change to Launched.\",Audit,Job Manager,1100,DMS_05_Outbound_Files,90,Production
22855"|rex max_match=0 field=DB "status change to (?&amp;lt;status&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Sep 2018 15:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387575#M113048</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-09-21T15:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract the very next word in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387576#M113049</link>
      <description>&lt;P&gt;Thanks a lot Rajesh, it worked!!(There was a minor mistake on my end).&lt;BR /&gt;
Really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2018 18:26:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-the-very-next-word-in-a-search/m-p/387576#M113049</guid>
      <dc:creator>Akumar294</dc:creator>
      <dc:date>2018-09-21T18:26:31Z</dc:date>
    </item>
  </channel>
</rss>

