<?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 Detecting multiple sourcetypes within a single archive in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90033#M18669</link>
    <description>&lt;P&gt;Hi Splunkers!&lt;/P&gt;

&lt;P&gt;Beyond configuring the autodetection of new sourcetypes, is specifying sourcetype detection via a wildcard possible when the log file is within a zip file?&lt;/P&gt;

&lt;P&gt;For the sake of illustration, I have a single zip file, with the following two files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/data/db2.zip
 - AUDIT_AUTHORIZATION_FAILURES.log
 - AUDIT_FIRST_READ.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[batch:///data/db2.zip:AUDIT_AUTHORIZATION_FAILURES*]
index = db2
sourcetype = db2_audit_auth_fail
move_policy = sinkhole
queue = parsingQueue

[batch:///data/db2.zip:AUDIT_FIRST_READ*]
index = db2
sourcetype = db2_audit_first_read
move_policy = sinkhole
queue = parsingQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not pretty I know, but I'd rather avoid having to configure automatic sourcetype recognition as the events are multi-lined and painful.&lt;/P&gt;

&lt;P&gt;Cheers &amp;amp; Beers,&lt;/P&gt;

&lt;P&gt;RT&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jul 2012 02:28:55 GMT</pubDate>
    <dc:creator>rturk</dc:creator>
    <dc:date>2012-07-04T02:28:55Z</dc:date>
    <item>
      <title>Detecting multiple sourcetypes within a single archive</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90033#M18669</link>
      <description>&lt;P&gt;Hi Splunkers!&lt;/P&gt;

&lt;P&gt;Beyond configuring the autodetection of new sourcetypes, is specifying sourcetype detection via a wildcard possible when the log file is within a zip file?&lt;/P&gt;

&lt;P&gt;For the sake of illustration, I have a single zip file, with the following two files:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/data/db2.zip
 - AUDIT_AUTHORIZATION_FAILURES.log
 - AUDIT_FIRST_READ.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[batch:///data/db2.zip:AUDIT_AUTHORIZATION_FAILURES*]
index = db2
sourcetype = db2_audit_auth_fail
move_policy = sinkhole
queue = parsingQueue

[batch:///data/db2.zip:AUDIT_FIRST_READ*]
index = db2
sourcetype = db2_audit_first_read
move_policy = sinkhole
queue = parsingQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Not pretty I know, but I'd rather avoid having to configure automatic sourcetype recognition as the events are multi-lined and painful.&lt;/P&gt;

&lt;P&gt;Cheers &amp;amp; Beers,&lt;/P&gt;

&lt;P&gt;RT&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2012 02:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90033#M18669</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-07-04T02:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting multiple sourcetypes within a single archive</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90034#M18670</link>
      <description>&lt;P&gt;Are the events within the two log files quite distinct?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2012 13:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90034#M18670</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2012-07-05T13:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting multiple sourcetypes within a single archive</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90035#M18671</link>
      <description>&lt;P&gt;So I've found the way to fix the issue. Luckily (as Drainy asked) there are only a few distinct filenames in each of the archives, such as:&lt;/P&gt;

&lt;P&gt;db2_20120620.zip&lt;BR /&gt;
 - AUDIT_FIRST_READ.TXT&lt;BR /&gt;
 - AUDIT_FIRST_WRITE.TXT&lt;BR /&gt;
 - AUDIT_AUTHORIZATION_FAIL.TXT&lt;/P&gt;

&lt;P&gt;So to apply file specific sourcetypeing I did the following:&lt;BR /&gt;
 - In my inputs.conf, I don't specify the sourcetype.&lt;BR /&gt;
 - In my props.conf, I override the sourcetype based on the source. eg:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::.../db2_\d+.zip:./AUDIT_FIRST_READ.TXT]
sourcetype = db2_audit_first_read

[source::.../db2_\d+.zip:./AUDIT_FIRST_WRITE.TXT]
sourcetype = db2_audit_first_write

[source::.../db2_\d+.zip:./AUDIT_AUTHORIZATION_FAIL.TXT]
sourcetype = db2_audit_authorization_fail
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I define my sourcetypes as I would normally.&lt;/P&gt;

&lt;P&gt;Hope this helps someone &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:05:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90035#M18671</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2020-09-28T12:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Detecting multiple sourcetypes within a single archive</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90036#M18672</link>
      <description>&lt;P&gt;They are indeed. Thanks for the comment... it twigged how I should do it. Thankfully there are only a few different types of files and they are consistently named.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Jul 2012 01:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Detecting-multiple-sourcetypes-within-a-single-archive/m-p/90036#M18672</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-07-15T01:16:29Z</dc:date>
    </item>
  </channel>
</rss>

