<?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: Extracting text from fields Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441982#M125534</link>
    <description>&lt;P&gt;you will have to write a regex for instance your example-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults| eval x =" Message = The ball is red."
| rex field=x "\w+ = \w+ \w+ \w+ (?&amp;lt;string&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Feb 2019 20:00:16 GMT</pubDate>
    <dc:creator>Vijeta</dc:creator>
    <dc:date>2019-02-01T20:00:16Z</dc:date>
    <item>
      <title>Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441980#M125532</link>
      <description>&lt;P&gt;How would you create a new field for example, color, by extracting the text from the value to an existing field, for example Message.&lt;/P&gt;

&lt;P&gt;Message = The ball is red. &lt;/P&gt;

&lt;P&gt;Problem &lt;BR /&gt;
Want new field : color set to value = red&lt;/P&gt;

&lt;P&gt;This is a Field Extraction Question&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 19:42:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441980#M125532</guid>
      <dc:creator>hredd</dc:creator>
      <dc:date>2019-02-01T19:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441981#M125533</link>
      <description>&lt;P&gt;Hi @hredd&lt;/P&gt;

&lt;P&gt;By default fields/value pairs that are seperated by an equals or a full colon will typically be extracted automatically. If they aren't then you can try using &lt;CODE&gt;| extract&lt;/CODE&gt; like so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults | eval _raw="color set to value = red" | extract&lt;/CODE&gt;  (this is just an example but substitute the first two sections with your normal search.&lt;/P&gt;

&lt;P&gt;Otherwise you can do something like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults | eval _raw="color set to value = red" | rex field=_raw "value\s*=\s*(?&amp;lt;my_new_field&amp;gt;\S+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope you find this helpful&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 19:58:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441981#M125533</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-01T19:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441982#M125534</link>
      <description>&lt;P&gt;you will have to write a regex for instance your example-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults| eval x =" Message = The ball is red."
| rex field=x "\w+ = \w+ \w+ \w+ (?&amp;lt;string&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 20:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441982#M125534</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-02-01T20:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441983#M125535</link>
      <description>&lt;P&gt;So this seems good for testing the regex, I guess I am looking for a more permanent solution. &lt;/P&gt;

&lt;P&gt;As in every new search containing the new extracted field. &lt;/P&gt;

&lt;P&gt;The example is as so:&lt;/P&gt;

&lt;P&gt;Message : blah blah blah. blah blah. the file was approved by 'Microsoft'.&lt;/P&gt;

&lt;P&gt;This company name changes and is sometimes not present. &lt;/P&gt;

&lt;P&gt;The goal is to make, in this example, newFieldForCompanyName = Microsoft show up in every new search &lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 20:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441983#M125535</guid>
      <dc:creator>hredd</dc:creator>
      <dc:date>2019-02-01T20:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441984#M125536</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "'(?&amp;lt;newFieldForCompanyName&amp;gt;[^']+)'[^']*$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Feb 2019 03:36:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441984#M125536</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-02T03:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441985#M125537</link>
      <description>&lt;P&gt;Hi @hredd&lt;/P&gt;

&lt;P&gt;After you run your search, expand an event that has the field in it. Then click the button that displays and select &lt;CODE&gt;Extract new fields&lt;/CODE&gt;. The wizard will guide you to create a permanent extraction that will run whenever anyone does a search.&lt;/P&gt;

&lt;P&gt;All the best. Chris.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2019 03:44:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441985#M125537</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-02T03:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting text from fields Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441986#M125538</link>
      <description>&lt;P&gt;you can try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Message=\"The ball is red\"" 
| kv | fields - _raw _time
| rex field=Message "\w+\s\w+\s\w+\s(?P&amp;lt;clr&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Feb 2019 09:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-text-from-fields-Question/m-p/441986#M125538</guid>
      <dc:creator>vinod94</dc:creator>
      <dc:date>2019-02-04T09:05:07Z</dc:date>
    </item>
  </channel>
</rss>

