<?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 filtering by hostname and sourcetype in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/filtering-by-hostname-and-sourcetype/m-p/502796#M85639</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I need some leads on an issue. I am having trouble in data forwarding from splunk HF to 3rd party. My prop.conf file below:&lt;BR /&gt;
[host::hostname]&lt;BR /&gt;
TRANSFORMS-weblog-matrix = send_to_syslog_EFH,send_to_index. &lt;BR /&gt;
But this is forwarding all the logs from the host. but instead I want to send one of the sourcetype from the host.&lt;/P&gt;

&lt;P&gt;Is it possible to filter by both hostname and sourcetype? If so, please peovide some sample props.conf and transformas.conf.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:34:15 GMT</pubDate>
    <dc:creator>graju89</dc:creator>
    <dc:date>2020-09-30T02:34:15Z</dc:date>
    <item>
      <title>filtering by hostname and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/filtering-by-hostname-and-sourcetype/m-p/502796#M85639</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I need some leads on an issue. I am having trouble in data forwarding from splunk HF to 3rd party. My prop.conf file below:&lt;BR /&gt;
[host::hostname]&lt;BR /&gt;
TRANSFORMS-weblog-matrix = send_to_syslog_EFH,send_to_index. &lt;BR /&gt;
But this is forwarding all the logs from the host. but instead I want to send one of the sourcetype from the host.&lt;/P&gt;

&lt;P&gt;Is it possible to filter by both hostname and sourcetype? If so, please peovide some sample props.conf and transformas.conf.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/filtering-by-hostname-and-sourcetype/m-p/502796#M85639</guid>
      <dc:creator>graju89</dc:creator>
      <dc:date>2020-09-30T02:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: filtering by hostname and sourcetype</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/filtering-by-hostname-and-sourcetype/m-p/502797#M85640</link>
      <description>&lt;P&gt;Hi graju89,&lt;BR /&gt;
see this &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/Forwarding/Forwarddatatothird-partysystemsd"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/Forwarding/Forwarddatatothird-partysystemsd&lt;/A&gt; and &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/Admin/Transformsconf"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Anyway to filter for two parameters there are two ways:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;if you can find one of the parameters in the raw logs you can use it to filter logs in transfroms.conf: e.g. if you want to forwarder to third party syslogs, in the beginning of each event you can find the host IP address, so you can use sourcetype as main stanza in props.conf and regex with that IP address in REGEX of transforms.conf.&lt;/LI&gt;
&lt;LI&gt;otherwise you can use the &lt;CODE&gt;SOURCE_KEY = MetaData:Host&lt;/CODE&gt; option in your transforms.conf, e.g. something like this:&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
TRANSFORMS-weblog-matrix = send_to_syslog_EFH,send_to_index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[send_to_syslog_EFH]
SOURCE_KEY = MetaData:Host
REGEX = your_host
DEST_KEY=_SYSLOG_ROUTING
FORMAT=my_syslog_group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 07:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/filtering-by-hostname-and-sourcetype/m-p/502797#M85640</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-10-18T07:08:36Z</dc:date>
    </item>
  </channel>
</rss>

