<?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 extract values &amp;quot;good&amp;quot; and &amp;quot;bad&amp;quot; from my sample data into a new field named STATUS? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281925#M85101</link>
    <description>&lt;P&gt;&lt;CODE&gt;... | rex "(?&amp;lt;STATUS&amp;gt;good|bad)"&lt;/CODE&gt; will help you &lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 07:18:06 GMT</pubDate>
    <dc:creator>raj_mpl</dc:creator>
    <dc:date>2019-04-09T07:18:06Z</dc:date>
    <item>
      <title>How to extract values "good" and "bad" from my sample data into a new field named STATUS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281920#M85096</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I have a log file in which all the events has this below lines as common;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;04:03:28 04/12/2016 good    201961028   1456 - Validation_Competed - ProductCode_3446565    0.133 sec, 1 row, 0 5:75127 200

04:03:32 04/12/2016 bad  201961028  1456 - Validation_Competed - ProductCode_3446569    0.133 sec, 1 row, 0 5:75127 200
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here in the above 2 events we have the words "&lt;STRONG&gt;good&lt;/STRONG&gt;" and "&lt;STRONG&gt;bad&lt;/STRONG&gt;" and I need to a create a new field by name "&lt;STRONG&gt;STATUS&lt;/STRONG&gt;" for them which should have its values as either "good" or "bad".&lt;/P&gt;

&lt;P&gt;Can some one please advise me the right REX command to execute here?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Roopesh&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 12:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281920#M85096</guid>
      <dc:creator>roopeshetty</dc:creator>
      <dc:date>2016-04-12T12:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values "good" and "bad" from my sample data into a new field named STATUS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281921#M85097</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
This regex should work for you : \d\s(\w+)\s\d&lt;/P&gt;

&lt;P&gt;Hope this is what you are looking for. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 12:36:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281921#M85097</guid>
      <dc:creator>apurva1707</dc:creator>
      <dc:date>2016-04-12T12:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values "good" and "bad" from my sample data into a new field named STATUS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281922#M85098</link>
      <description>&lt;P&gt;So the simplest answer of course is &lt;CODE&gt;... | rex "(?&amp;lt;STATUS&amp;gt;good|bad)"&lt;/CODE&gt; this assumes however that neither good nor bad show up in your events other than the status field and your status field only takes the values of good and bad.&lt;/P&gt;

&lt;P&gt;You could anchor the regular expression based on the date format outside of the capturing group. You'd want to play with samples of your data and a site like regex101.com to develop expressions. Eventually you could build a field extraction for your sourcetype and not need the Rex command in your search.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 12:41:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281922#M85098</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2016-04-12T12:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values "good" and "bad" from my sample data into a new field named STATUS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281923#M85099</link>
      <description>&lt;P&gt;This is a simple log format and rex should be fairly easy to extract the field you are interested and as suggested above. &lt;BR /&gt;
If you not comfortable with rex , I would suggest to use the splunk field extractor utility and create the required field first during search time and then you can use the newly created field in your search .&lt;/P&gt;

&lt;P&gt;See below documentation for more details .&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 13:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281923#M85099</guid>
      <dc:creator>badrinath_itrs</dc:creator>
      <dc:date>2016-04-12T13:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values "good" and "bad" from my sample data into a new field named STATUS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281924#M85100</link>
      <description>&lt;P&gt;Some readings&lt;BR /&gt;
Field Extraction (saved) from Splunk Web&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Managesearch-timefieldextractions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Managesearch-timefieldextractions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Field Extraction from conf files editing&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Knowledge/Aboutfields#Configure_field_extractions_directly_in_.conf_files"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/Knowledge/Aboutfields#Configure_field_extractions_directly_in_.conf_files&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Interactive field extraction from Search page&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.8/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.8/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Inline field extractions using rex&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Search/Extractfieldswithsearchcommands"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Search/Extractfieldswithsearchcommands&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 13:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281924#M85100</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-12T13:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values "good" and "bad" from my sample data into a new field named STATUS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281925#M85101</link>
      <description>&lt;P&gt;&lt;CODE&gt;... | rex "(?&amp;lt;STATUS&amp;gt;good|bad)"&lt;/CODE&gt; will help you &lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 07:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-quot-good-quot-and-quot-bad-quot-from-my/m-p/281925#M85101</guid>
      <dc:creator>raj_mpl</dc:creator>
      <dc:date>2019-04-09T07:18:06Z</dc:date>
    </item>
  </channel>
</rss>

