<?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 Multiple sourcetypes in the same directory in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108350#M22798</link>
    <description>&lt;P&gt;I know this question has been asked numerous times before, because I've read most of the questions and answers. I still can't seem to get it right, no matter what I try. We have several Windows servers running JBoss. The folder structure is similar to the following...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;D:\jboss\server\&amp;lt;ContainerName&amp;gt;\log\
    access.2011-05-24.log
    app.log
    boot.log
    stderr.log
    stdout.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, the goal is to pull access.YYYY-MM-DD.log as sourcetype=access_common and everything else as sourcetype=log4j. Ideally, I'd like to be able to create a JBoss server class and push a generic configuration out to all of our JBoss servers to pull the logs.&lt;/P&gt;

&lt;P&gt;I've tried several different things, but nothing seems to work as expected. I've tried using simple regular expressions in the [monitor] stanzas as suggested in one answer and I've tried a very general [monitor:] stanza pointing at the directory with accompanying [source::] stanzas to filter the file names and specify sourcetypes in props.conf. I've tried more than that, but those two seemed to be the most promising. I've used &lt;A href="https://servername:8089/services/admin/inputstatus/TailingProcessor:FileStatus"&gt;https://servername:8089/services/admin/inputstatus/TailingProcessor:FileStatus&lt;/A&gt; to verify the files are being read, but they don't seem to be getting indexed, or they don't have the expected sourcetype if they are.&lt;/P&gt;

&lt;P&gt;I know things have changed from version to version in Splunk and maybe the problem is that I'm trying things that don't work anymore. Can someone set me straight?&lt;/P&gt;

&lt;P&gt;My current configuration is as follows...&lt;/P&gt;

&lt;P&gt;inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#
# JBoss - Common Log Files
#
[monitor://D:\jboss\server\*\log\*.log]
index = fod-web
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...\\access\.\d{4}-\d{2}-\d{2}\.log$]
sourcetype = access_common

[source::...\\(?!access)[\w-_.]+\.log$]
sourcetype = log4j
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 24 May 2011 16:07:32 GMT</pubDate>
    <dc:creator>jheilman</dc:creator>
    <dc:date>2011-05-24T16:07:32Z</dc:date>
    <item>
      <title>Multiple sourcetypes in the same directory</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108350#M22798</link>
      <description>&lt;P&gt;I know this question has been asked numerous times before, because I've read most of the questions and answers. I still can't seem to get it right, no matter what I try. We have several Windows servers running JBoss. The folder structure is similar to the following...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;D:\jboss\server\&amp;lt;ContainerName&amp;gt;\log\
    access.2011-05-24.log
    app.log
    boot.log
    stderr.log
    stdout.log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, the goal is to pull access.YYYY-MM-DD.log as sourcetype=access_common and everything else as sourcetype=log4j. Ideally, I'd like to be able to create a JBoss server class and push a generic configuration out to all of our JBoss servers to pull the logs.&lt;/P&gt;

&lt;P&gt;I've tried several different things, but nothing seems to work as expected. I've tried using simple regular expressions in the [monitor] stanzas as suggested in one answer and I've tried a very general [monitor:] stanza pointing at the directory with accompanying [source::] stanzas to filter the file names and specify sourcetypes in props.conf. I've tried more than that, but those two seemed to be the most promising. I've used &lt;A href="https://servername:8089/services/admin/inputstatus/TailingProcessor:FileStatus"&gt;https://servername:8089/services/admin/inputstatus/TailingProcessor:FileStatus&lt;/A&gt; to verify the files are being read, but they don't seem to be getting indexed, or they don't have the expected sourcetype if they are.&lt;/P&gt;

&lt;P&gt;I know things have changed from version to version in Splunk and maybe the problem is that I'm trying things that don't work anymore. Can someone set me straight?&lt;/P&gt;

&lt;P&gt;My current configuration is as follows...&lt;/P&gt;

&lt;P&gt;inputs.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#
# JBoss - Common Log Files
#
[monitor://D:\jboss\server\*\log\*.log]
index = fod-web
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...\\access\.\d{4}-\d{2}-\d{2}\.log$]
sourcetype = access_common

[source::...\\(?!access)[\w-_.]+\.log$]
sourcetype = log4j
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2011 16:07:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108350#M22798</guid>
      <dc:creator>jheilman</dc:creator>
      <dc:date>2011-05-24T16:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes in the same directory</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108351#M22799</link>
      <description>&lt;P&gt;Could you paste the configuration you are using to try and do your sourcetyping? Also, you may want to review the following, there are some pretty good example configurations:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://blogs.splunk.com/2010/02/11/sourcetypes-gone-wild/"&gt;http://blogs.splunk.com/2010/02/11/sourcetypes-gone-wild/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I think you should be using:&lt;/P&gt;

&lt;P&gt;[source::…\access.\d{4}-\d{2}-\d{2}.log$]&lt;/P&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;P&gt;[source::...\(?!access)[\w+.log$]&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2011 17:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108351#M22799</guid>
      <dc:creator>jbsplunk</dc:creator>
      <dc:date>2011-05-24T17:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple sourcetypes in the same directory</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108352#M22800</link>
      <description>&lt;P&gt;I updated the original question with the configuration I'm using currently.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2011 14:19:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-sourcetypes-in-the-same-directory/m-p/108352#M22800</guid>
      <dc:creator>jheilman</dc:creator>
      <dc:date>2011-05-25T14:19:05Z</dc:date>
    </item>
  </channel>
</rss>

