<?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 Put more than one data source into one index in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431223#M75458</link>
    <description>&lt;P&gt;We have 4 servers running applications that should log into splunk.&lt;BR /&gt;
Logtypes are :&lt;BR /&gt;
  2x apache  = sourcetype=access_combined &lt;BR /&gt;
  1app x log4j = sourcetype=log4j&lt;BR /&gt;
  1app x log4j = sourcetype=log4j but different contents&lt;/P&gt;

&lt;P&gt;inputs.conf will be &lt;BR /&gt;
udp:4444 &lt;BR /&gt;
sourcetype=????&lt;/P&gt;

&lt;P&gt;Question: &lt;BR /&gt;
Is splunk able to select the correct parser?  How is this done?&lt;BR /&gt;
Which sourcetype do I have to enter in the inputs.conf?&lt;BR /&gt;
How can I expand the field extraction in props/transforms if I do notknow the sourcetype for this special input? (I may have some other log4j inputs, too)&lt;/P&gt;</description>
    <pubDate>Wed, 30 May 2018 13:10:48 GMT</pubDate>
    <dc:creator>tfechner</dc:creator>
    <dc:date>2018-05-30T13:10:48Z</dc:date>
    <item>
      <title>Put more than one data source into one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431223#M75458</link>
      <description>&lt;P&gt;We have 4 servers running applications that should log into splunk.&lt;BR /&gt;
Logtypes are :&lt;BR /&gt;
  2x apache  = sourcetype=access_combined &lt;BR /&gt;
  1app x log4j = sourcetype=log4j&lt;BR /&gt;
  1app x log4j = sourcetype=log4j but different contents&lt;/P&gt;

&lt;P&gt;inputs.conf will be &lt;BR /&gt;
udp:4444 &lt;BR /&gt;
sourcetype=????&lt;/P&gt;

&lt;P&gt;Question: &lt;BR /&gt;
Is splunk able to select the correct parser?  How is this done?&lt;BR /&gt;
Which sourcetype do I have to enter in the inputs.conf?&lt;BR /&gt;
How can I expand the field extraction in props/transforms if I do notknow the sourcetype for this special input? (I may have some other log4j inputs, too)&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 13:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431223#M75458</guid>
      <dc:creator>tfechner</dc:creator>
      <dc:date>2018-05-30T13:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: Put more than one data source into one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431224#M75459</link>
      <description>&lt;P&gt;I would really suggest figuring out a different solution than sending several very different log types to a single UDP input. At least send different log types to different ports, but even better: just put a Universal Forwarder on each of those servers and read the logs locally from files.&lt;/P&gt;

&lt;P&gt;Although there are ways to set a generic sourcetype in inputs.conf and then use props and transforms to override that based on event content, that gets messy quite quickly and certain index time configurations (like TIME_FORMAT) will not be able to use the overridden sourcetype.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 13:49:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431224#M75459</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-30T13:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Put more than one data source into one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431225#M75460</link>
      <description>&lt;P&gt;Technically speaking, you can do something like this:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::udp:4444]
TRANSFORMS-set_sourcetype = set_sourcetype_access_combined, set_sourcetype_log4j, set_sourcetype_something_else
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[set_sourcetype_access_combined]
DEST_KEY = MetaData:Sourcetype
REGEX = some regex that matches your access_combined data
# For example, the REGEX used for Cisco ASA matching is REGEX = %ASA-\d-\d{6}
# Check out the Splunk Add-on for Cisco ASA for more examples.
FORMAT = sourcetype::access_combined

[set_sourcetype_log4j]
DEST_KEY = MetaData:Sourcetype
REGEX = some regex that matches your log4j data
FORMAT = sourcetype::log4j

[set_sourcetype_something_else]
DEST_KEY = MetaData:Sourcetype
REGEX = some regex that matches your other data (you get the idea by now...)
FORMAT = sourcetype::your_sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But, as @FrankVI pointed out, this can be cumbersome over time to maintain the regexes if you data changes.&lt;/P&gt;</description>
      <pubDate>Wed, 30 May 2018 14:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431225#M75460</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-05-30T14:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Put more than one data source into one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431226#M75461</link>
      <description>&lt;P&gt;Thanks for that elaboration on what &lt;EM&gt;can&lt;/EM&gt; be done &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/109095"&gt;@jconger&lt;/a&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It is not just cumbersome though. If the events require different index-time processing (e.g. different TIME_FORMAT setting, different LINE_BREAKER, etc.) it will simply be impossible to use a combined input like this, as you cannot use meta field overrides to influence the index-time config that get's applied.&lt;/P&gt;

&lt;P&gt;E.g. following your example, if you would add the following to props.conf, it would get completely ignored for this data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[access_combined]
TIME_FORMAT = foo
LINE_BREAKER = yada

[log4j]
TIME_FORMAT = bar
LINE_BREAKER = bla
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431226#M75461</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-09-29T19:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Put more than one data source into one index</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431227#M75462</link>
      <description>&lt;P&gt;ok this might come with some limitations but helps me in a similar context where I have to split the events from one datasource into different indexes based on regex (distinguish user access rights)&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 09:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Put-more-than-one-data-source-into-one-index/m-p/431227#M75462</guid>
      <dc:creator>tfechner</dc:creator>
      <dc:date>2018-06-01T09:05:03Z</dc:date>
    </item>
  </channel>
</rss>

