<?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: How to create multiple source types from a single log file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331813#M61471</link>
    <description>&lt;P&gt;That did exactly what I was trying to accomplish. Thanks so much for the fast response. &lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2017 19:25:14 GMT</pubDate>
    <dc:creator>acsanders</dc:creator>
    <dc:date>2017-04-17T19:25:14Z</dc:date>
    <item>
      <title>How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331811#M61469</link>
      <description>&lt;P&gt;I am ingesting 1 file that has multiple server IP addresses. I need to source type each server based on the IP address. I have tried using the props.conf and transforms.conf with no luck. Any help would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 14:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331811#M61469</guid>
      <dc:creator>acsanders</dc:creator>
      <dc:date>2017-04-17T14:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331812#M61470</link>
      <description>&lt;P&gt;We would need some sample events and your current props.conf/transforms.conf. Meanwhile, check if something like this works for you.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#Inputs.conf on forwarder
[monitor://&amp;lt;&amp;lt;path of file&amp;gt;]
index = ..
sourcetype = some_default_sourcetype

#props.conf on Indexers/Heavy Forwarder
[some_default_sourcetype]
...event parsing stuffs..
TRANSFORMS-overridest = change_st_by_IP1,change_st_by_IP2,change_st_by_IP3,....

#transforms.conf on Indexers/Heavy Forwarder. Replace IPs with your exact values)
[change_st_by_IP1]
REGEX = (10\.11\.12\.13)
FORMAT = sourcetype::yourNewSourceType1
DEST_KEY = MetaData:Sourcetype

[change_st_by_IP2]
REGEX = (20\.21\.22\.23)
FORMAT = sourcetype::yourNewSourceType2
DEST_KEY = MetaData:Sourcetype

..
similar stanza for other IPs...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Apr 2017 16:12:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331812#M61470</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-17T16:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331813#M61471</link>
      <description>&lt;P&gt;That did exactly what I was trying to accomplish. Thanks so much for the fast response. &lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 19:25:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331813#M61471</guid>
      <dc:creator>acsanders</dc:creator>
      <dc:date>2017-04-17T19:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331814#M61472</link>
      <description>&lt;P&gt;I have an additional question.  I need to do the same thing with a string that I am doing with an IP address. Whats the correct way to do this. How do I set up the REGEX for a string?&lt;/P&gt;

&lt;P&gt;transforms.comf&lt;BR /&gt;
[change_st_by_IP9]&lt;BR /&gt;
REGEX = Plinapp748&lt;BR /&gt;&lt;BR /&gt;
FORMAT = sourcetype::McAfee_ePO&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:41:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331814#M61472</guid>
      <dc:creator>acsanders</dc:creator>
      <dc:date>2020-09-29T13:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331815#M61473</link>
      <description>&lt;P&gt;It's the same way as IP. IP has a special character dot so I had to escape it. If your string just has alphanumeric values, just specify them as it is in REGEX.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 14:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331815#M61473</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-18T14:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331816#M61474</link>
      <description>&lt;P&gt;Thanks so much for the help. Worked like a charm.  &lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 16:30:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/331816#M61474</guid>
      <dc:creator>acsanders</dc:creator>
      <dc:date>2017-04-18T16:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create multiple source types from a single log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/610165#M105735</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a question here, can we use different index for each sourcetype in these conf files?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 18:29:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-create-multiple-source-types-from-a-single-log-file/m-p/610165#M105735</guid>
      <dc:creator>vanheer</dc:creator>
      <dc:date>2022-08-19T18:29:55Z</dc:date>
    </item>
  </channel>
</rss>

