<?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: filed extraction on specific path in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462715#M130458</link>
    <description>&lt;P&gt;Sure,&lt;BR /&gt;
 1-I’m going to the search and enter "source = "/opt/logs/*"&lt;BR /&gt;
2-click on “field extraction”&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/File:Extract_new_fields.png"&gt;https://docs.splunk.com/File:Extract_new_fields.png&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2019 19:13:36 GMT</pubDate>
    <dc:creator>indeed_2000</dc:creator>
    <dc:date>2019-12-16T19:13:36Z</dc:date>
    <item>
      <title>filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462706#M130449</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
I want to create "field extract" on all logs that exist in below address.&lt;BR /&gt;
/opt/logs/file1.log&lt;BR /&gt;
/opt/logs/file2.log&lt;BR /&gt;
/opt/logs/file3.log&lt;/P&gt;

&lt;P&gt;when I create new "field extract" at first step ask me choose a source type: file1.log or file2.log or file3.log ?&lt;BR /&gt;
How can extract field on all of them like "/opt/logs/*"   ?&lt;BR /&gt;
Should create index for this path?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 15:05:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462706#M130449</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-16T15:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462707#M130450</link>
      <description>&lt;P&gt;May I know how you are trying to extract? &lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 15:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462707#M130450</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-12-16T15:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462708#M130451</link>
      <description>&lt;P&gt;If all of the logs have the same structure then your field extraction can be done on one of them.  When you do that, create a new sourcetype.  Use that sourcetype when you index /opt/logs/* and the field extraction will be applied to all of the files in that directory.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 15:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462708#M130451</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-12-16T15:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462709#M130452</link>
      <description>&lt;P&gt;Hi @mehrdad_2000,&lt;BR /&gt;
let me understand:&lt;BR /&gt;
you have a list of files that contain logs,&lt;BR /&gt;
you want to associate to all logs a field called "field extract" that's a part of the source (e.g. the last part of the path),&lt;BR /&gt;
I don't understand what do you mean when you say "at first step ask me choose a file".&lt;/P&gt;

&lt;P&gt;Anyway to extract a field from the source field, it's easy using a regex like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_index
| rex field=source "(?&amp;lt;field_extract&amp;gt;\w*\.log)$"
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 16:00:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462709#M130452</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-16T16:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462710#M130453</link>
      <description>&lt;P&gt;create new sourcetype as you mention "my_SourceType", but when I hit "field extraction" it has only show  "my_SourceType" and it is empty ! there is no event!&lt;/P&gt;

&lt;P&gt;while when going to the search it and enter "source = "/opt/logs/*" show all events!&lt;/P&gt;

&lt;P&gt;Any recommendation?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:20:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462710#M130453</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2020-09-30T03:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462711#M130454</link>
      <description>&lt;P&gt;1-I have several log files with different structure and want extract specific field on all of them.&lt;BR /&gt;
2-At first step of "field extract" Splunk ask sourcetype.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 16:17:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462711#M130454</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-16T16:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462712#M130455</link>
      <description>&lt;P&gt;Hi @mehrdad_2000,&lt;BR /&gt;
because usually knowledge objects (as fields) are  related to a sourcetype and every log ingestion must have a sourcetype.&lt;BR /&gt;
What's the sourcetype you associated to the above files?&lt;BR /&gt;
You can use it.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 16:25:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462712#M130455</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-16T16:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462713#M130456</link>
      <description>&lt;P&gt;Custom sourcetype &lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 18:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462713#M130456</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-16T18:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462714#M130457</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.0/Data/Getstartedwithgettingdatain"&gt;Get started with getting data in&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Have a look at this.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 19:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462714#M130457</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-16T19:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462715#M130458</link>
      <description>&lt;P&gt;Sure,&lt;BR /&gt;
 1-I’m going to the search and enter "source = "/opt/logs/*"&lt;BR /&gt;
2-click on “field extraction”&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/File:Extract_new_fields.png"&gt;https://docs.splunk.com/File:Extract_new_fields.png&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 19:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462715#M130458</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2019-12-16T19:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462716#M130459</link>
      <description>&lt;P&gt;Hi @mehrdad_2000,&lt;BR /&gt;
as I said use this custom sourcetype, the only important hing is to use one sourcetype otherwise it's difficoult to use the fields.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 07:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462716#M130459</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-12-17T07:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: filed extraction on specific path</title>
      <link>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462717#M130460</link>
      <description>&lt;P&gt;Did you put the new sourcetype in your inputs.conf?  The change will only apply to new data.  Anything already indexed will be under the old sourcetype.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype = mysourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 12:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/filed-extraction-on-specific-path/m-p/462717#M130460</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-12-17T12:59:12Z</dc:date>
    </item>
  </channel>
</rss>

