<?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 ingest logs from a single file and split them into 2 source types or indexes? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/543284#M90705</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140181"&gt;@sundareshr&lt;/a&gt;&amp;nbsp;Appreciate the response.&amp;nbsp; Was looking for this one.&lt;/P&gt;</description>
    <pubDate>Thu, 11 Mar 2021 00:29:04 GMT</pubDate>
    <dc:creator>ArchieCrozier</dc:creator>
    <dc:date>2021-03-11T00:29:04Z</dc:date>
    <item>
      <title>How to ingest logs from a single file and split them into 2 source types or indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/256349#M49226</link>
      <description>&lt;P&gt;I've been trying to ingest logs from a single log file into 2 source types. For example, looking at the 'messages' file in Linux, I want to split the logs from this file into different source types or indexes. &lt;/P&gt;

&lt;P&gt;Sourcetype 1: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jul 10 09:20:01 systemd: Started Session 27535 of user root.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sourcetype 2: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jul 10 09:13:26 rsyslogd: [origin software="rsyslogd" swVersion="X.X.X" x-pid="18406" x-info="http://www.rsyslog.com"] rsyslogd
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How should I approach this? &lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 20:24:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/256349#M49226</guid>
      <dc:creator>daniel_augustyn</dc:creator>
      <dc:date>2016-07-14T20:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to ingest logs from a single file and split them into 2 source types or indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/256350#M49227</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;Props&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...regex_to_match_filename] 
TRANSFORMS-st-sys = force-sourcetype-systemd
TRANSFORMS-st-rsys = force-sourcetype-rsyslogd
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;Transforms&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[force-sourcetype-systemd]
DEST_KEY = MetaData::Sourcetype 
REGEX = (systemd)
FORMAT = sourcetype::$1 
WRITE_META = true

[force-sourcetype-rsyslogd]
DEST_KEY = MetaData::Sourcetype 
REGEX = (rsyslogd)
FORMAT = sourcetype::$1 
WRITE_META = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.1/Admin/Transformsconf"&gt;https://docs.splunk.com/Documentation/Splunk/6.4.1/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 20:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/256350#M49227</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-14T20:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to ingest logs from a single file and split them into 2 source types or indexes?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/543284#M90705</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/140181"&gt;@sundareshr&lt;/a&gt;&amp;nbsp;Appreciate the response.&amp;nbsp; Was looking for this one.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 00:29:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-ingest-logs-from-a-single-file-and-split-them-into-2/m-p/543284#M90705</guid>
      <dc:creator>ArchieCrozier</dc:creator>
      <dc:date>2021-03-11T00:29:04Z</dc:date>
    </item>
  </channel>
</rss>

