<?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 SourceType Override based on Host's IP Address in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62598#M12512</link>
    <description>&lt;P&gt;I am attempting to override the sourcetype of an event that is coming in on UDP:516 based on the host address but I haven't had any success.  This is what I have so far.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[source::UDP:516]&lt;BR /&gt;
TRANSFORMS = transSnort&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[transSnort]&lt;BR /&gt;
REGEX="10.41.140.151"&lt;BR /&gt;
FORMAT= sourcetype::snort&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;

&lt;P&gt;Any ideas what I am doing wrong?&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2012 19:38:40 GMT</pubDate>
    <dc:creator>rmcdougal</dc:creator>
    <dc:date>2012-05-29T19:38:40Z</dc:date>
    <item>
      <title>SourceType Override based on Host's IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62598#M12512</link>
      <description>&lt;P&gt;I am attempting to override the sourcetype of an event that is coming in on UDP:516 based on the host address but I haven't had any success.  This is what I have so far.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[source::UDP:516]&lt;BR /&gt;
TRANSFORMS = transSnort&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[transSnort]&lt;BR /&gt;
REGEX="10.41.140.151"&lt;BR /&gt;
FORMAT= sourcetype::snort&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;/P&gt;

&lt;P&gt;Any ideas what I am doing wrong?&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2012 19:38:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62598#M12512</guid>
      <dc:creator>rmcdougal</dc:creator>
      <dc:date>2012-05-29T19:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: SourceType Override based on Host's IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62599#M12513</link>
      <description>&lt;P&gt;First, you don't have an identifier for your TRANSFORMS directive. I honestly do not know what behaviour this causes in Splunk - you should use an identifier (for instance "TRANSFORMS-transsnort").&lt;/P&gt;

&lt;P&gt;Second, you've put the IP number within quotes - Splunk will match everything that follows REGEX=, including the quotes, so that's a very likely reason why it's not working.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2012 20:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62599#M12513</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-29T20:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: SourceType Override based on Host's IP Address</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62600#M12514</link>
      <description>&lt;P&gt;You will also want to qualify the IP address of the incoming remote host as a RegEx. Examples below.&lt;BR /&gt;
In transforms.conf create a stanza for this regex rule that sets the metadata property for indexing or sourcetype.&lt;/P&gt;

&lt;P&gt;The metdata config setting for sourcetype is:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
FORMAT = sourcetype::networkdata:appliancename&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
The metadata config setting for index is:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
FORMAT = index::myindexname&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
Put the ip address list of similar sources together. &lt;BR /&gt;
Then in props.conf reference this label. &lt;BR /&gt;
Distribute this configuration to all tiers of Splunk deployment (Forwarding, Indexing, and Search) &lt;/P&gt;

&lt;P&gt;See: &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/Admin/Transformsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.2/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
 #######  props.conf&lt;BR /&gt;
[source::UDP:514]&lt;BR /&gt;
TRANSFORMS = syslog_mydatasoureytpe&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;#######   transforms.conf &lt;BR /&gt;
   ### Note: You should escape your periods in the IP address too &lt;BR /&gt;
   ###           so you don't accidentally match 10a31b20c19 &lt;BR /&gt;
   ###  (couldn't format post to show that. .)&lt;/P&gt;

&lt;P&gt;# one ip address exactly&lt;BR /&gt;
[syslog_mydatasoureytpe]&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
REGEX = :\d\d\s+(?:\d+\s+|(?:user|daemon|local.?).\w+\s+)&lt;EM&gt;[?(10.0.0.5)[\w.-]&lt;/EM&gt;]?\s&lt;BR /&gt;
FORMAT = sourcetype::mydatasourcetype&lt;BR /&gt;
FORMAT = index::myindexname&lt;/P&gt;

&lt;P&gt;# two ip addresses&lt;BR /&gt;
[syslog_mydatasoureytpe]&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
REGEX = :\d\d\s+(?:\d+\s+|(?:user|daemon|local.?).\w+\s+)&lt;EM&gt;[?(10.0.0.5|10.0.0.6)[\w.-]&lt;/EM&gt;]?\s&lt;BR /&gt;
FORMAT = sourcetype::mydatasourcetype&lt;BR /&gt;
FORMAT = index::myindexname&lt;/P&gt;

&lt;P&gt;# a range of IP addresses .10-.19&lt;BR /&gt;
[syslog_mydatasoureytpe]&lt;BR /&gt;
DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
DEST_KEY = _MetaData:Index&lt;BR /&gt;
REGEX = :\d\d\s+(?:\d+\s+|(?:user|daemon|local.?).\w+\s+)&lt;EM&gt;[?(10.0.0.1\d)[\w.-]&lt;/EM&gt;]?\s&lt;BR /&gt;
FORMAT = sourcetype::mydatasourcetype&lt;BR /&gt;
FORMAT = index::myindexname&lt;BR /&gt;
&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:16:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SourceType-Override-based-on-Host-s-IP-Address/m-p/62600#M12514</guid>
      <dc:creator>mcronkrite</dc:creator>
      <dc:date>2020-09-28T16:16:27Z</dc:date>
    </item>
  </channel>
</rss>

