<?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: Problems with sourcetypes on syslog collectors-How can I set a sourcetype using REGEX? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617086#M106556</link>
    <description>&lt;P&gt;Use syslogs own configuration to put different types in different folders such as based on the sending system source ip. Then just set the sourcetype by path on that folder in your inputs. How you do that in syslog will vary on which one you are using.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Oct 2022 04:47:03 GMT</pubDate>
    <dc:creator>starcher</dc:creator>
    <dc:date>2022-10-14T04:47:03Z</dc:date>
    <item>
      <title>Problems with sourcetypes on syslog collectors-How can I set a sourcetype using REGEX?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/616936#M106545</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have multiple syslog collectors (practically a heavy forwarder that picks up logs from disk).&lt;BR /&gt;I am struggling to find a way of setting a specific sourcetype for parts of this logs that are picked up from disk.&lt;BR /&gt;&lt;BR /&gt;/data/syslog/ contains thousands of folders with IP adresses, and i want to set a specific sourcetype for lets say 100 of them... Ive tried using regex and whitelist, but it seems like two stanzas with the same name wont work:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[monitor:///data/syslog/tcp/.../*.log]

sourcetype = rsyslog
host_segment = 4
index = xxx_syslog
blacklist = .*\.gz$

[monitor:///data/syslog/tcp/.../*.log]

sourcetype = vmw-syslog
host_segment = 4
index = xxx_syslog
blacklist = .*\.gz$
whitelist = \/data\/syslog\/tcp\/(10\.21[1289]\.75\.\d+|10\.143\.15\.\d+|10\.21[01]\.70\.\d+|10\.250\.191\.50|10\.30\.221\.19[1-2]|11\.36\.1[128]\.\d+|10\.37\.12\.\d+|10\.45\.[12]\.\d+|10\.6[23]\.12.\d+|10\.63\.10\.20|10\.67\.(0|64)\.\d+|10\.67\.67\.67)\/&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Any idea on how i can set an sourcetype using REGEX?&lt;BR /&gt;(I can not rewrite the sourcetype on a heavy forwarder, because this data should be parsed and get a new sourcetype from an TA app (vmware esxilogs), and i cant parse data two times).&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 14:31:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/616936#M106545</guid>
      <dc:creator>Fonzie2k</dc:creator>
      <dc:date>2022-10-13T14:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sourcetypes on syslog collectors-How can I set a sourcetype using REGEX?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617086#M106556</link>
      <description>&lt;P&gt;Use syslogs own configuration to put different types in different folders such as based on the sending system source ip. Then just set the sourcetype by path on that folder in your inputs. How you do that in syslog will vary on which one you are using.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 04:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617086#M106556</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2022-10-14T04:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sourcetypes on syslog collectors-How can I set a sourcetype using REGEX?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617666#M106632</link>
      <description>&lt;P&gt;Thanks for the suggestion. We rather not touch the rsyslog config, as we want to keep it standard across multiple customers/tenants. Our solution was to create the following transforms on the HF's, to rewrite the sourcetype from spesific hosts (regex):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;props.conf:
[rsyslog]
TRANSFORMS-hemit_force_sourcetype_vmware1 = hemit_force_sourcetype_vmware1

transforms.conf:
[hemit_force_sourcetype_vmware1]
SOURCE_KEY = MetaData:Host
REGEX = ^host::(10\.24[1289]\.70\.\d+|etc|etc)

DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::vmw-syslog&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 09:35:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617666#M106632</guid>
      <dc:creator>Fonzie2k</dc:creator>
      <dc:date>2022-10-19T09:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sourcetypes on syslog collectors-How can I set a sourcetype using REGEX?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617705#M106634</link>
      <description>&lt;P&gt;But that solution means you can't apply sourcetype specific index-time config like timestamping and linebreaking, source/sourcetype overrides etc.. So that's far from ideal and will certainly cause a bunch of headaches with certain types of data?&lt;/P&gt;&lt;P&gt;Crafting your syslog config such that it puts data that needs a different sourcetype into separate folders is typically the way to go. That way you can easily write distinct input stanzas for each sourcetype.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:01:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Problems-with-sourcetypes-on-syslog-collectors-How-can-I-set-a/m-p/617705#M106634</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2022-10-19T14:01:48Z</dc:date>
    </item>
  </channel>
</rss>

