<?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 Differentiating between Sourcetypes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108877#M22909</link>
    <description>&lt;P&gt;Greetings Splunkers!&lt;/P&gt;

&lt;P&gt;I am currently collecting logs centrally for a content delivery platform for indexing into Splunk.&lt;/P&gt;

&lt;P&gt;The vendor in their infinite wisdom has decided that the &lt;CODE&gt;service_monitor&lt;/CODE&gt; logs should use the same file naming convention, despite the format of the logs differing based on the type of device that is generating it.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Filename:&lt;/STRONG&gt; &lt;CODE&gt;service_monitor_10.10.18.49_20110920_204501_00363&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;Originating Device Type:&lt;/STRONG&gt; Service Engine&lt;BR /&gt;
&lt;STRONG&gt;Fields:&lt;/STRONG&gt; &lt;CODE&gt;date time movie-streamer-threshold-exceeded movie-streamer-augment-threshold-exceeded movie-streamer-stopped...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Filename:&lt;/STRONG&gt; &lt;CODE&gt;service_monitor_10.10.18.41_20111026_225501_03295&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;Originating Device Type:&lt;/STRONG&gt; Service Router&lt;BR /&gt;
&lt;STRONG&gt;Fields:&lt;/STRONG&gt; &lt;CODE&gt;date time sr-cpu-percentage sr-mem(bytes) requests-received http-normal-requests-received...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Keeping in mind that these files are kept in the same directory. It would no doubt be possible to determine the role by the IP address, however this would involve a  LARGE &lt;CODE&gt;inputs.conf&lt;/CODE&gt; with a stanza something like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host://&amp;lt;ip_address&amp;gt;_service_monitor'&lt;BR /&gt;
sourcetype=service_monitor_se&lt;BR /&gt;
...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;For every device on the platform.&lt;/P&gt;

&lt;P&gt;Is there a way I can differentiate between the two automatically?&lt;/P&gt;

&lt;P&gt;Many thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;RT&lt;/P&gt;</description>
    <pubDate>Mon, 14 Nov 2011 01:14:01 GMT</pubDate>
    <dc:creator>rturk</dc:creator>
    <dc:date>2011-11-14T01:14:01Z</dc:date>
    <item>
      <title>Differentiating between Sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108877#M22909</link>
      <description>&lt;P&gt;Greetings Splunkers!&lt;/P&gt;

&lt;P&gt;I am currently collecting logs centrally for a content delivery platform for indexing into Splunk.&lt;/P&gt;

&lt;P&gt;The vendor in their infinite wisdom has decided that the &lt;CODE&gt;service_monitor&lt;/CODE&gt; logs should use the same file naming convention, despite the format of the logs differing based on the type of device that is generating it.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Filename:&lt;/STRONG&gt; &lt;CODE&gt;service_monitor_10.10.18.49_20110920_204501_00363&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;Originating Device Type:&lt;/STRONG&gt; Service Engine&lt;BR /&gt;
&lt;STRONG&gt;Fields:&lt;/STRONG&gt; &lt;CODE&gt;date time movie-streamer-threshold-exceeded movie-streamer-augment-threshold-exceeded movie-streamer-stopped...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Filename:&lt;/STRONG&gt; &lt;CODE&gt;service_monitor_10.10.18.41_20111026_225501_03295&lt;/CODE&gt;&lt;BR /&gt;
&lt;STRONG&gt;Originating Device Type:&lt;/STRONG&gt; Service Router&lt;BR /&gt;
&lt;STRONG&gt;Fields:&lt;/STRONG&gt; &lt;CODE&gt;date time sr-cpu-percentage sr-mem(bytes) requests-received http-normal-requests-received...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Keeping in mind that these files are kept in the same directory. It would no doubt be possible to determine the role by the IP address, however this would involve a  LARGE &lt;CODE&gt;inputs.conf&lt;/CODE&gt; with a stanza something like:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[host://&amp;lt;ip_address&amp;gt;_service_monitor'&lt;BR /&gt;
sourcetype=service_monitor_se&lt;BR /&gt;
...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;For every device on the platform.&lt;/P&gt;

&lt;P&gt;Is there a way I can differentiate between the two automatically?&lt;/P&gt;

&lt;P&gt;Many thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;RT&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2011 01:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108877#M22909</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2011-11-14T01:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Differentiating between Sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108878#M22910</link>
      <description>&lt;P&gt;If you extract each hosts by using a regular expression, does it work for you? The setting will be following in inputs.conf.&lt;/P&gt;

&lt;P&gt;[monitor://&lt;PATH&gt;]&lt;BR /&gt;
host_regex = $YOUR_REGEX&lt;/PATH&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:05:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108878#M22910</guid>
      <dc:creator>Takajian</dc:creator>
      <dc:date>2020-09-28T10:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Differentiating between Sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108879#M22911</link>
      <description>&lt;P&gt;Thanks Takajian. I can see what you tried to do there, but it's not quite what I was after. Fortunately I have found an swer that does what I need it to do... see below &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks again for your answer!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2011 03:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108879#M22911</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2011-11-14T03:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Differentiating between Sourcetypes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108880#M22912</link>
      <description>&lt;P&gt;Playing around has come up with the goods.&lt;/P&gt;

&lt;P&gt;With a list of the Service Routers, we were able to come up with the following stanza in our &lt;CODE&gt;inputs.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[batch:///...path_to_file.../service_monitor_(10.10.10.163_|192.168.159.68_|10.10.10.172_|192.168.159.76_|10.10.0.76_|192.168.159.172_|10.10.10.67_|192.168.159.164_)*]
host_regex = service_monitor_(\d+.\d+.\d+.\d+)_\d+_\d+_\d+
sourcetype = service_monitor_sr
index = service_monitor_sr
crcSalt = &amp;lt;SOURCE&amp;gt;
disabled = false
move_policy = sinkhole
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because configuration files are processed sequentially, having a "catch-all" below it for the other files captures the rest of them as &lt;CODE&gt;service_monitor_se&lt;/CODE&gt; sourcetypes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[batch:///...path_to_file.../service_monitor*]
host_regex = service_monitor_(\d+.\d+.\d+.\d+)_\d+_\d+_\d+
sourcetype = cds_service_monitor_engine
index = cds_service_monitor_engine
crcSalt = &amp;lt;SOURCE&amp;gt;
disabled = false
move_policy = sinkhole
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this helps someone &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2011 03:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Differentiating-between-Sourcetypes/m-p/108880#M22912</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2011-11-14T03:54:28Z</dc:date>
    </item>
  </channel>
</rss>

