<?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 source/sourcetype defined by folder names in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92643#M19230</link>
    <description>&lt;P&gt;is it possible to define the source and sourcetype fields to match a folder name?   On each server our log structure for our products are as follows &lt;CODE&gt;F:\Logs\Company_Name\Product\file.txt&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;I'd like for the Company_Name folders to be defined as the source, and product folder to be defined as source type.&lt;/P&gt;

&lt;P&gt;how do I go about doing this?  I've read that this can be done in props for actual files, but I don't see an example for an actual folder location.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2013 18:34:01 GMT</pubDate>
    <dc:creator>mhorn</dc:creator>
    <dc:date>2013-04-12T18:34:01Z</dc:date>
    <item>
      <title>source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92643#M19230</link>
      <description>&lt;P&gt;is it possible to define the source and sourcetype fields to match a folder name?   On each server our log structure for our products are as follows &lt;CODE&gt;F:\Logs\Company_Name\Product\file.txt&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;I'd like for the Company_Name folders to be defined as the source, and product folder to be defined as source type.&lt;/P&gt;

&lt;P&gt;how do I go about doing this?  I've read that this can be done in props for actual files, but I don't see an example for an actual folder location.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 18:34:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92643#M19230</guid>
      <dc:creator>mhorn</dc:creator>
      <dc:date>2013-04-12T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92644#M19231</link>
      <description>&lt;P&gt;It's actually done with both the props.conf and the transforms.conf&lt;/P&gt;

&lt;P&gt;basically you have a props.conf kinda like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::F:\\Logs\\Company_Name\\Productfile.txt]
TRANSFORMS-setSourceType=setCompanySourceType
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then a transforms.conf like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setCompanySourceType]
SOURCE_KEY = MetaData:Source
REGEX = F:\\Logs\\(\w+_\w+)\\
FORMAT = sourcetype::$1
DEST_KEY = MetaData:Sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you can switch this around for whatever combination you need but basically you are assigning metaData thru regex.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 20:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92644#M19231</guid>
      <dc:creator>Kate_Lawrence-G</dc:creator>
      <dc:date>2013-04-12T20:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92645#M19232</link>
      <description>&lt;P&gt;I guess you could do it off the &lt;CODE&gt;source&lt;/CODE&gt; value, along these lines (have not tried it myself)&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::f:\Logs\...\*.txt]
TRANSFORMS-change_stuff = change_sourcetype, change_source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[change_sourcetype]
SOURCE_KEY = MetaData:Source
REGEX = F:\\Logs\\[^\\]+\\([^\\]+)\\
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::$1

[change_source]
SOURCE_KEY = MetaData:Source
REGEX = F:\\Logs\\([^\\]+)\\
DEST_KEY = MetaData:Source
FORMAT = source::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However I think you should think a bit on whether you really want to do that. See this section in the manual;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Whysourcetypesmatter"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Whysourcetypesmatter&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;/Kristian&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 20:30:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92645#M19232</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-12T20:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92646#M19233</link>
      <description>&lt;P&gt;Ooops, there I go for spending too much time editing. Should not watch movies while answering questions...  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 20:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92646#M19233</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-12T20:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92647#M19234</link>
      <description>&lt;P&gt;thanks for the reply guys.  i'm going to work on this over the weekend and see how it goes.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 21:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92647#M19234</guid>
      <dc:creator>mhorn</dc:creator>
      <dc:date>2013-04-12T21:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92648#M19235</link>
      <description>&lt;P&gt;That totally depends on which movie it is.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 22:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92648#M19235</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-04-12T22:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92649#M19236</link>
      <description>&lt;P&gt;ok, I think I'm missing something as it appears to be pulling the data in as before.  When I open the props/transform file from the system\default folder it states not to update that file, changes should be made in the system\local directory.  So I copied both files and put them in the system\local directory and updated them as you suggested.  I stopped the server and forwarder, then cleaned out the data and turned them on to pull it in again.  Data appears to be coming in as before.  By this I mean I would like to go to the search field and just type source="company_name".  What am I missing?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 17:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92649#M19236</guid>
      <dc:creator>mhorn</dc:creator>
      <dc:date>2013-04-15T17:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92650#M19237</link>
      <description>&lt;P&gt;Hmm.. either there is something wrong with your props.conf stanza header, i.e. it does not match your logs (and thus do not being passed to the transform), or you are looking at old events (this only affects new data coming in).&lt;/P&gt;

&lt;P&gt;Or there is a spelling error somewhere.&lt;/P&gt;

&lt;P&gt;And as always, put them in &lt;CODE&gt;$SPLUNK_HOME/etc/system/local&lt;/CODE&gt; for now. move to an app later if you want/need.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 17:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92650#M19237</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-15T17:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92651#M19238</link>
      <description>&lt;P&gt;where exactly is the stanza header?  maybe I don't have it in the correct location in the file.  I didn't see in the props file a stanza header area.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 18:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92651#M19238</guid>
      <dc:creator>mhorn</dc:creator>
      <dc:date>2013-04-15T18:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92652#M19239</link>
      <description>&lt;P&gt;sorry bout the confusion, what I mean is where you put &lt;CODE&gt;[source::blah blah]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;perhaps you could post your props.conf and transforms.conf (relevant sections only). Anonymize as needed.&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 18:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92652#M19239</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-15T18:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92653#M19240</link>
      <description>&lt;P&gt;no need to apologize...still trying to figure out the splunk stuff, so i'm not making it easy on you!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 18:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92653#M19240</guid>
      <dc:creator>mhorn</dc:creator>
      <dc:date>2013-04-15T18:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92654#M19241</link>
      <description>&lt;P&gt;now I'm updating the props/transform on my splunk server, not on the forwarder correct?&lt;BR /&gt;
I'd attach the two files, but I don't see a button to do this, and copy/paste surpasses the number of characters allowed in the boxes.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 19:38:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92654#M19241</guid>
      <dc:creator>mhorn</dc:creator>
      <dc:date>2013-04-15T19:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: source/sourcetype defined by folder names</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92655#M19242</link>
      <description>&lt;P&gt;on the server, yes. Unless it's a heavy forwarder.&lt;BR /&gt;
No you can't attach files like that, but you could just edit your original post with the relevant portions of the props.conf and transforms.conf files&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2013 20:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/source-sourcetype-defined-by-folder-names/m-p/92655#M19242</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-15T20:01:08Z</dc:date>
    </item>
  </channel>
</rss>

