<?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 Regex for extraction of Pattern from existing field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121592#M32725</link>
    <description>&lt;P&gt;I want to extract a pattern from existing field "source" whose value is /abc/Prod/log/p123ot12. I want to extract p123ot12 from this source field and want to put it in new field called job.&lt;/P&gt;

&lt;P&gt;Need your assistance ASAP. &lt;/P&gt;</description>
    <pubDate>Sun, 24 May 2015 22:00:48 GMT</pubDate>
    <dc:creator>Sourabhv05</dc:creator>
    <dc:date>2015-05-24T22:00:48Z</dc:date>
    <item>
      <title>Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121592#M32725</link>
      <description>&lt;P&gt;I want to extract a pattern from existing field "source" whose value is /abc/Prod/log/p123ot12. I want to extract p123ot12 from this source field and want to put it in new field called job.&lt;/P&gt;

&lt;P&gt;Need your assistance ASAP. &lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 22:00:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121592#M32725</guid>
      <dc:creator>Sourabhv05</dc:creator>
      <dc:date>2015-05-24T22:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121593#M32726</link>
      <description>&lt;P&gt;Hi Sourabhv05,&lt;/P&gt;

&lt;P&gt;So, you want an answer asap &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Your regex is pretty easy, you're looking for everything after the last &lt;CODE&gt;/&lt;/CODE&gt; so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search goes here | rex field=source "(?&amp;lt;job&amp;gt;[^\/]*)$" | table job
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will extract everything after the last &lt;CODE&gt;/&lt;/CODE&gt; and put it in a field called &lt;CODE&gt;job&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You can test and learn regex over here &lt;A href="https://regex101.com"&gt;https://regex101.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps and was asap enough &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 22:40:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121593#M32726</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-05-24T22:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121594#M32727</link>
      <description>&lt;P&gt;Hi Mus,&lt;/P&gt;

&lt;P&gt;I am getting error while pasting this regex after my search. Error is Error in 'SearchOperator:regex': Usage: regex &amp;lt;field&amp;gt; (=|!=) &amp;lt;regex&amp;gt;. &lt;/P&gt;

&lt;P&gt;My base search is index = abc host = "xyz" &lt;/P&gt;

&lt;P&gt;When i have put it like index = abc host = "xyz" |regex field=source "(?&amp;lt;job&amp;gt;[^\/]*)$" | table job it gave me above error. Please help&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 22:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121594#M32727</guid>
      <dc:creator>Sourabhv05</dc:creator>
      <dc:date>2015-05-24T22:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121595#M32728</link>
      <description>&lt;P&gt;Well do you have a field called source? Try &lt;CODE&gt;rex&lt;/CODE&gt; instead of &lt;CODE&gt;regex&lt;/CODE&gt; and if it's still not working try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=abc host="xyz" |rex "(?&amp;amp;lt;job&amp;amp;gt;[^/]*)$" | table job
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 May 2015 22:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121595#M32728</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-05-24T22:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121596#M32729</link>
      <description>&lt;P&gt;thanks alot Mus. It works perfectly. &lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 22:58:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121596#M32729</guid>
      <dc:creator>Sourabhv05</dc:creator>
      <dc:date>2015-05-24T22:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121597#M32730</link>
      <description>&lt;P&gt;I need one more help. I have a pattern ABCDEF**** in my logs which are getting indexed on Splunk . I need to put that pattern in an field which i want to display in table along with job, How can i do that ?&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 23:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121597#M32730</guid>
      <dc:creator>Sourabhv05</dc:creator>
      <dc:date>2015-05-24T23:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121598#M32731</link>
      <description>&lt;P&gt;Okay, instead of asking for more help; Why don't you read the docs about the &lt;CODE&gt;field extractor&lt;/CODE&gt; &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.3/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt; and learn how to use it. It helps you to get anything out of your events into fields, which then can be used in any further search within the same app. Make your life much easier &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2015 23:14:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121598#M32731</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-05-24T23:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121599#M32732</link>
      <description>&lt;P&gt;Add the field called source to your table..&lt;/P&gt;

&lt;P&gt;... | table source , myfield1, myfield2, myfieldN&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2015 03:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121599#M32732</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-05-25T03:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for extraction of Pattern from existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121600#M32733</link>
      <description>&lt;P&gt;Uppsss, my bad. looks like I got the additional question wrong &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2015 04:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-extraction-of-Pattern-from-existing-field/m-p/121600#M32733</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-05-25T04:33:59Z</dc:date>
    </item>
  </channel>
</rss>

