<?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 Field extraction in a string in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138914#M11834</link>
    <description>&lt;P&gt;Hello to all,&lt;/P&gt;

&lt;P&gt;how can I make a field extraction from a string:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;qwertyuiop&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;from the third to seventh character..&lt;/P&gt;

&lt;P&gt;In order to obtain as a result:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;ertyuio&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;thanks in advance&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2013 16:12:04 GMT</pubDate>
    <dc:creator>retesi</dc:creator>
    <dc:date>2013-11-12T16:12:04Z</dc:date>
    <item>
      <title>Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138914#M11834</link>
      <description>&lt;P&gt;Hello to all,&lt;/P&gt;

&lt;P&gt;how can I make a field extraction from a string:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;qwertyuiop&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;from the third to seventh character..&lt;/P&gt;

&lt;P&gt;In order to obtain as a result:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;ertyuio&lt;/STRONG&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 16:12:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138914#M11834</guid>
      <dc:creator>retesi</dc:creator>
      <dc:date>2013-11-12T16:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138915#M11835</link>
      <description>&lt;P&gt;well, with &lt;CODE&gt;rex&lt;/CODE&gt; you can do it like so, assuming that the string 'qwertyuiop' is in a field called &lt;CODE&gt;theString&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=theString "\w\w(?&amp;lt;result&amp;gt;\w{7})" | 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR with &lt;CODE&gt;eval&lt;/CODE&gt; you can do it like this;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval result=substr(theString, 3, 7) | 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope that helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 16:19:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138915#M11835</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-11-12T16:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138916#M11836</link>
      <description>&lt;P&gt;Just small correction to rex&lt;/P&gt;

&lt;P&gt;"\w\w\w(?&lt;RESULT&gt;\w{7})"&lt;/RESULT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 16:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138916#M11836</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-12T16:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138917#M11837</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;There seems to be typo in your post as you are looking to extract 7 characters starting from character number 3 and not characters between 3rd till 7th characters.&lt;/P&gt;

&lt;P&gt;I am referring the same assumption which was mentioned in the post from "kristian.kolb".&lt;/P&gt;

&lt;P&gt;Let me know if following works for you or not.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=theString "\w{2}(?P&amp;lt;myvar&amp;gt;\w{7})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Saxena&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 16:54:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138917#M11837</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-11-12T16:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138918#M11838</link>
      <description>&lt;P&gt;\w\w(?&lt;RESULT&gt;\w{7}) and the eval will both grab the 3rd to 9th characters.&lt;/RESULT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 16:59:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138918#M11838</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2013-11-12T16:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138919#M11839</link>
      <description>&lt;P&gt;Note that you will not be able to search on this field by default since it doesn't correspond to a unique token in Splunk's index. If that's not a problem, all is fine. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 17:06:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138919#M11839</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-11-12T17:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction in a string</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138920#M11840</link>
      <description>&lt;P&gt;You will need to make an adjustment to fields.conf on the search head. &lt;/P&gt;

&lt;P&gt;Setting the INDEXED_VALUE to false should allow you to search on the extracted fields without the wild card. &lt;/P&gt;

&lt;P&gt;If one does not exist, you will want to create a fields.conf in $splunkhome/etc/system/local and add the below stanza to it. &lt;/P&gt;

&lt;P&gt;[ertyuio or whatever your extraction is named.] &lt;BR /&gt;
INDEXED_VALUE=false &lt;/P&gt;

&lt;P&gt;This should then allow the env=ertyuio search to return results. &lt;/P&gt;

&lt;P&gt;Below is a link to the docs page for fields .conf &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Admin/Fieldsconf"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.0/Admin/Fieldsconf&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;This is what we are changing, it is a bit counter intuitive, though ertyuio is in the event, since it is part of a word and does not exist exactly as "ertyuio" we want to set it as false as it does not count as being part of the raw text in the event. &lt;/P&gt;

&lt;P&gt;INDEXED_VALUE = [true|false||] &lt;BR /&gt;
* Set this to true if the value is in the raw text of the event. &lt;BR /&gt;
* Set this to false if the value is not in the raw text of the event. &lt;/P&gt;

&lt;P&gt;Give that a try for me if you can and let me know your result. It works in my test environment. &lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2017 14:27:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Field-extraction-in-a-string/m-p/138920#M11840</guid>
      <dc:creator>jpondrom_splunk</dc:creator>
      <dc:date>2017-10-24T14:27:59Z</dc:date>
    </item>
  </channel>
</rss>

