<?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 How to extract a substring of existing field values into a new field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-of-existing-field-values-into-a-new/m-p/224482#M66130</link>
    <description>&lt;P&gt;I want to make a new field with extracted values like Header.txt, LogMessage.xml , JSON_HEADER.json (it's from the second &lt;CODE&gt;_&lt;/CODE&gt; to the end of the string)&lt;/P&gt;

&lt;P&gt;Sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/home/collection/collections/data/TIBCOJNDIQAT4A/export/20/PL-ADMIN-11004.30A5748A69B1:ADF086E40_20160621223510_Header.txt

/home/collection/collections/data/TIBCOJNDIQAT4A/export/20/PL-ADMIN-11004.30A5748A69B1:ADF086E40_20160621223510_LogMessage.xml

/home/collection/collections/data/TIBCOJNDIQAT4A/export/20/PL-ADMIN-11004.30A5748A69B1:ADF086E40_20160621223510_JSON_HEADER.json
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 10:01:31 GMT</pubDate>
    <dc:creator>chvnc</dc:creator>
    <dc:date>2020-09-29T10:01:31Z</dc:date>
    <item>
      <title>How to extract a substring of existing field values into a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-of-existing-field-values-into-a-new/m-p/224482#M66130</link>
      <description>&lt;P&gt;I want to make a new field with extracted values like Header.txt, LogMessage.xml , JSON_HEADER.json (it's from the second &lt;CODE&gt;_&lt;/CODE&gt; to the end of the string)&lt;/P&gt;

&lt;P&gt;Sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/home/collection/collections/data/TIBCOJNDIQAT4A/export/20/PL-ADMIN-11004.30A5748A69B1:ADF086E40_20160621223510_Header.txt

/home/collection/collections/data/TIBCOJNDIQAT4A/export/20/PL-ADMIN-11004.30A5748A69B1:ADF086E40_20160621223510_LogMessage.xml

/home/collection/collections/data/TIBCOJNDIQAT4A/export/20/PL-ADMIN-11004.30A5748A69B1:ADF086E40_20160621223510_JSON_HEADER.json
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:01:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-of-existing-field-values-into-a-new/m-p/224482#M66130</guid>
      <dc:creator>chvnc</dc:creator>
      <dc:date>2020-09-29T10:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a substring of existing field values into a new field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-of-existing-field-values-into-a-new/m-p/224483#M66131</link>
      <description>&lt;P&gt;Try this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=&amp;lt;your_field&amp;gt; "([A-Za-z0-9]+_){2}(?&amp;lt;extracted_field&amp;gt;[^.]+.[^$\n ]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Disclaimer: This is a lousy regex.Someone will surely swoop in and save the day with an optimal regex. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 18:24:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-substring-of-existing-field-values-into-a-new/m-p/224483#M66131</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2016-06-22T18:24:59Z</dc:date>
    </item>
  </channel>
</rss>

