<?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 use a Splunk forwarder directory name (segment) as an event tag? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-a-Splunk-forwarder-directory-name-segment-as-an-event/m-p/280531#M53674</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I was wondering how to use a directory name (segment) as an event tag. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\bin\code\python\test_system\scoring\results\16\17055079037\some files log files here or in directory's below this.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The system outputs many hundreds of directories at the 17055079037 level.  I don't want to segment on host, source, or sourcetype (as I have manually defined these to cut the console spam). I'd just want the 17055079037 level to be reported as an event attribute, so when I open the error log within Splunk, I can readably see that the log file originated from the 17055079037 directory.&lt;/P&gt;

&lt;P&gt;I am guessing this is something to do with segmentation, but I don't know how to configure the inputs.conf for this.&lt;/P&gt;

&lt;P&gt;Any suggestions gratefully received.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2016 14:41:22 GMT</pubDate>
    <dc:creator>lsparrow</dc:creator>
    <dc:date>2016-04-11T14:41:22Z</dc:date>
    <item>
      <title>How to use a Splunk forwarder directory name (segment) as an event tag?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-a-Splunk-forwarder-directory-name-segment-as-an-event/m-p/280531#M53674</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I was wondering how to use a directory name (segment) as an event tag. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;C:\bin\code\python\test_system\scoring\results\16\17055079037\some files log files here or in directory's below this.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The system outputs many hundreds of directories at the 17055079037 level.  I don't want to segment on host, source, or sourcetype (as I have manually defined these to cut the console spam). I'd just want the 17055079037 level to be reported as an event attribute, so when I open the error log within Splunk, I can readably see that the log file originated from the 17055079037 directory.&lt;/P&gt;

&lt;P&gt;I am guessing this is something to do with segmentation, but I don't know how to configure the inputs.conf for this.&lt;/P&gt;

&lt;P&gt;Any suggestions gratefully received.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 14:41:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-a-Splunk-forwarder-directory-name-segment-as-an-event/m-p/280531#M53674</guid>
      <dc:creator>lsparrow</dc:creator>
      <dc:date>2016-04-11T14:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use a Splunk forwarder directory name (segment) as an event tag?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-a-Splunk-forwarder-directory-name-segment-as-an-event/m-p/280532#M53675</link>
      <description>&lt;P&gt;You can extract fields from other fields, in this case from &lt;CODE&gt;source&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf
[sourcetype, source, or host stanza]
EXTRACT-level = ^(?:[^\\]+\\){8}(?&amp;lt;level&amp;gt;[^\\]+) in source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That would give you a field &lt;CODE&gt;level&lt;/CODE&gt; set to the segment after the eighth backslash.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 21:02:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-a-Splunk-forwarder-directory-name-segment-as-an-event/m-p/280532#M53675</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-11T21:02:13Z</dc:date>
    </item>
  </channel>
</rss>

