<?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: Sourcetype Aliases in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Aliases/m-p/26849#M4461</link>
    <description>&lt;P&gt;I don't think this is what you want to do, though the specific answer to how to alias a sourcetype is given later. It seems to me that you simply want to specify a sourcetype for a set of input files. Normally, you can simply specify one when you create the input, either in the Manager GUI, or with &lt;CODE&gt;sourcetype = mysourcetype&lt;/CODE&gt; in inputs.conf, or with a sourcetype stanza based on source in props.conf.&lt;/P&gt;

&lt;P&gt;If you were using a Splunk forwarder that would be it. If not, you may have to use a TRANSFORM stanza to modify/set the sourcetype at index time, much as with host names: &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Overridedefaulthostassignments" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Overridedefaulthostassignments&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You can rename sourcetypes in 4.x. &lt;CODE&gt;props.conf.spec&lt;/CODE&gt; says:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rename = &amp;lt;string&amp;gt;
* Renames &amp;lt;sourcetype&amp;gt; as &amp;lt;string&amp;gt;
* With renaming, you can search for the sourcetype with sourcetype=&amp;lt;string&amp;gt;
* To search for the original sourcetype without renaming, use the field _sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;therefore, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myoldsourcetype]
rename = mynewsourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 10 Aug 2010 13:59:44 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-08-10T13:59:44Z</dc:date>
    <item>
      <title>Sourcetype Aliases</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Aliases/m-p/26848#M4460</link>
      <description>&lt;P&gt;According to the documentation for Splunk version 3.x there is the ability to alias a sourcetype, however it does not appear to exist under version 4.x.&lt;/P&gt;

&lt;P&gt;I find myself in the position where I have many applications all logging via log4j and would like to be able to filter my searches on application type.&lt;/P&gt;

&lt;P&gt;I was hoping to be able to setup the forwarders via the CLI, adding the monitor statements with an explicit -sourcetype.&lt;/P&gt;

&lt;P&gt;The only other option I can see is to setup TAGs on each of the source statements based on filename (Can tags be managed automatically for certain sources, perhaps based on a regex?)&lt;/P&gt;

&lt;P&gt;Any suggestions or clarifications would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;mgh&lt;/P&gt;

&lt;P&gt;P.S. In case it was not immediately obvious, yes I am very new to splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2010 06:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Aliases/m-p/26848#M4460</guid>
      <dc:creator>mgherman</dc:creator>
      <dc:date>2010-08-10T06:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Aliases</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Aliases/m-p/26849#M4461</link>
      <description>&lt;P&gt;I don't think this is what you want to do, though the specific answer to how to alias a sourcetype is given later. It seems to me that you simply want to specify a sourcetype for a set of input files. Normally, you can simply specify one when you create the input, either in the Manager GUI, or with &lt;CODE&gt;sourcetype = mysourcetype&lt;/CODE&gt; in inputs.conf, or with a sourcetype stanza based on source in props.conf.&lt;/P&gt;

&lt;P&gt;If you were using a Splunk forwarder that would be it. If not, you may have to use a TRANSFORM stanza to modify/set the sourcetype at index time, much as with host names: &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Overridedefaulthostassignments" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Overridedefaulthostassignments&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You can rename sourcetypes in 4.x. &lt;CODE&gt;props.conf.spec&lt;/CODE&gt; says:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rename = &amp;lt;string&amp;gt;
* Renames &amp;lt;sourcetype&amp;gt; as &amp;lt;string&amp;gt;
* With renaming, you can search for the sourcetype with sourcetype=&amp;lt;string&amp;gt;
* To search for the original sourcetype without renaming, use the field _sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;therefore, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myoldsourcetype]
rename = mynewsourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Aug 2010 13:59:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Aliases/m-p/26849#M4461</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-10T13:59:44Z</dc:date>
    </item>
  </channel>
</rss>

