<?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: Override host field with event data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301222#M56938</link>
    <description>&lt;P&gt;Great information, thanks! problem solved then.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 13:19:38 GMT</pubDate>
    <dc:creator>raduand</dc:creator>
    <dc:date>2017-10-10T13:19:38Z</dc:date>
    <item>
      <title>Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301213#M56929</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am indexing some data from a file monitor and i want to override the host field with data that lays inside the events. Below is a sample of the data and the values i want for the host field with bold. &lt;/P&gt;

&lt;P&gt;Mon Oct 09 2017 15:24:18 &lt;STRONG&gt;SE-001&lt;/STRONG&gt; sshd[5905]: Failed password for invalid user postgres from 49.212.64.138 port 4856 ssh2&lt;BR /&gt;
Mon Oct 09 2017 15:24:13 &lt;STRONG&gt;ACME-005&lt;/STRONG&gt; sshd[2792]: Failed password for nsharpe from 10.2.10.163 port 1148 ssh2&lt;BR /&gt;
Mon Oct 09 2017 15:24:12 &lt;STRONG&gt;ops-sys-006&lt;/STRONG&gt; sshd[4105]: Failed password for sync from 233.77.49.94 port 4595 ssh2&lt;BR /&gt;
Mon Oct 09 2017 15:24:19 &lt;STRONG&gt;PROD-MFS-001&lt;/STRONG&gt; sshd[74897]: pam_unix(sshd:session): session closed for user nsharpe by (uid=0)&lt;BR /&gt;
Mon Oct 09 2017 15:24:07 &lt;STRONG&gt;PROD-MFS-001&lt;/STRONG&gt; su: pam_unix(su:session): session closed for user root&lt;/P&gt;

&lt;P&gt;The data is indexed under linux_secure sourcetype. In order to achieve the host overriding, i added one props.conf and one transforms.conf stanza in /etc/system/local on the indexers:&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[linux_secure]&lt;BR /&gt;
TRANSFORMS-sethost = set_hostname_linux_secure&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[set_hostname_linux_secure]&lt;BR /&gt;
REGEX = (?&amp;lt;=:\d{2}\s).*?(?=\s)&lt;BR /&gt;
FORMAT = host::$1&lt;BR /&gt;
DEST_KEY = MetaData:Host&lt;/P&gt;

&lt;P&gt;The above configuration is not working, and the events are still indexing with host = the name of the forwarder where they come from. &lt;/P&gt;

&lt;P&gt;Any idea what's wrong with this configuration and how can i implement the host overriding?&lt;/P&gt;

&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301213#M56929</guid>
      <dc:creator>raduand</dc:creator>
      <dc:date>2020-09-29T16:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301214#M56930</link>
      <description>&lt;P&gt;To me it looks like your problem is in your config. You are calling out &lt;CODE&gt;$1&lt;/CODE&gt; in the &lt;CODE&gt;FORMAT&lt;/CODE&gt; line, but you don't actually have a capture group that you can use. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (?&amp;lt;=:\d{2}\s)(\S+)(?=\s)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It should at least have something in &lt;CODE&gt;$1&lt;/CODE&gt; for it to set the host with (the &lt;CODE&gt;(\S+)&lt;/CODE&gt; will be the only capture group that returns a value).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 18:30:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301214#M56930</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-10-09T18:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301215#M56931</link>
      <description>&lt;P&gt;Hey @raduand, if they solved your problem, remember to "√Accept" an answer to award karma points &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 00:17:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301215#M56931</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-10-10T00:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301216#M56932</link>
      <description>&lt;P&gt;You are right about the config problem, but even after updating the Regex expression to capture a group that returns a value the host overriding still doesn't work. &lt;/P&gt;

&lt;P&gt;Any other suggestion or idea how to troubleshoot this?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 08:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301216#M56932</guid>
      <dc:creator>raduand</dc:creator>
      <dc:date>2017-10-10T08:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301217#M56933</link>
      <description>&lt;P&gt;problem is not solved yet &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 11:04:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301217#M56933</guid>
      <dc:creator>raduand</dc:creator>
      <dc:date>2017-10-10T11:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301218#M56934</link>
      <description>&lt;P&gt;Are you using distributed environment??? &lt;/P&gt;

&lt;P&gt;These configuration should be added on indexer if you are using universal forwarder. &lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:05:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301218#M56934</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2017-10-10T13:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301219#M56935</link>
      <description>&lt;P&gt;Yes, i am using distributed environment. The data is coming from a heavy forwarder. The configuration was placed on the indexers and the host overriding was not working.&lt;/P&gt;

&lt;P&gt;I just placed props.conf and transforms.conf on the Heavy Forwarder and it's working like a charm. &lt;/P&gt;

&lt;P&gt;I need to know why the indexers are not performing this parsing.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301219#M56935</guid>
      <dc:creator>raduand</dc:creator>
      <dc:date>2017-10-10T13:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301220#M56936</link>
      <description>&lt;P&gt;I'm running Splunk 6.6.3 &lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:11:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301220#M56936</guid>
      <dc:creator>raduand</dc:creator>
      <dc:date>2017-10-10T13:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301221#M56937</link>
      <description>&lt;P&gt;If you are using Heavy Forwarder then you have to place these configurations on HF only. Because with HF, Splunk completes parsing on HF itself and indexer only indexes data. Please refer following link to know more about Splunk indexing.&lt;BR /&gt;
&lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:15:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301221#M56937</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2017-10-10T13:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Override host field with event data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301222#M56938</link>
      <description>&lt;P&gt;Great information, thanks! problem solved then.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Override-host-field-with-event-data/m-p/301222#M56938</guid>
      <dc:creator>raduand</dc:creator>
      <dc:date>2017-10-10T13:19:38Z</dc:date>
    </item>
  </channel>
</rss>

