<?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: Field Extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501070#M139546</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval path="/opt/splunk/var/log/splunk/splunkd.log" 
| rex field=path "(^(?P&amp;lt;dir_name&amp;gt;.+)\/)([^\/]+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval path="/opt/splunk/var/log/splunk/splunkd.log" 
| eval dir_name=replace(path,"(\/[^\/]+)$","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 05 Feb 2020 04:38:08 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2020-02-05T04:38:08Z</dc:date>
    <item>
      <title>Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501069#M139545</link>
      <description>&lt;P&gt;Need some suggestion for field extraction.&lt;/P&gt;

&lt;P&gt;Take this as an example: &lt;BR /&gt;
I have a file path /opt/splunk/var/log/splunk/splunkd.log &lt;/P&gt;

&lt;P&gt;There is already a field extraction done for this called file_name.&lt;/P&gt;

&lt;P&gt;I would like to do a filed extraction with just the Directory path ( /opt/splunk/var/log/splunk/) and name dir_name.&lt;/P&gt;

&lt;P&gt;The problem arises when I try to do a new extraction, as the path is sort of already used by file_name and splunk mentions that I need "To highlight text that is already part of an existing extraction, first turn off the existing extractions"&lt;/P&gt;

&lt;P&gt;My doubt here is. If I turn of the existing extraction and then create one for dir_name, would I still be able to use file_name or does that get over-ridden by the new extraction?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
AKN&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:00:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501069#M139545</guid>
      <dc:creator>aknsun</dc:creator>
      <dc:date>2020-09-30T04:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501070#M139546</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval path="/opt/splunk/var/log/splunk/splunkd.log" 
| rex field=path "(^(?P&amp;lt;dir_name&amp;gt;.+)\/)([^\/]+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval path="/opt/splunk/var/log/splunk/splunkd.log" 
| eval dir_name=replace(path,"(\/[^\/]+)$","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Feb 2020 04:38:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501070#M139546</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-02-05T04:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501071#M139547</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval file_name="/opt/splunk/var/log/splunk/splunkd.log" 
| rex field=file_name "(?&amp;lt;dir_name&amp;gt;\/.*\/)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, how about this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2020 10:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction/m-p/501071#M139547</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-05T10:03:50Z</dc:date>
    </item>
  </channel>
</rss>

