<?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: How to force to set certain fields (host and sourcetype) for events from HEC local stanza for each token in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369077#M67022</link>
    <description>&lt;P&gt;you are right about HEC configuration if sourcetype, host and over fields are not defined in event.&lt;BR /&gt;
But if sender define this fields, he will override valued defined in inputs.conf.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2017 20:07:34 GMT</pubDate>
    <dc:creator>gots</dc:creator>
    <dc:date>2017-08-14T20:07:34Z</dc:date>
    <item>
      <title>How to force to set certain fields (host and sourcetype) for events from HEC local stanza for each token</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369074#M67019</link>
      <description>&lt;P&gt;Is it possible to force Splunk to set up specific fields (sourcetype, source, host) from HEC &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#HTTP_Event_Collector_.28HEC.29_-_Local_stanza_for_each_token"&gt;local stanza&lt;/A&gt; &lt;BR /&gt;
  but not from event parameters?&lt;/P&gt;

&lt;P&gt;For example if i have inputs.conf like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[http://http_test]
description = test hec input
disabled = 0
connection_host = dns
index = main
source = test_hec_source
sourcetype = test_hec_sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Client can rewrite index, host, source and sourcetype if post in data json like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "host": fake_host,
  "sourcetype": fake_sourcetype,
  "index": fake_index,
  "source": fake_source
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But in certain situations i need to deny modifications of this parameters. Of course i can do it with transforms.conf, but it is not convinient.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369074#M67019</guid>
      <dc:creator>gots</dc:creator>
      <dc:date>2017-08-14T19:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to force to set certain fields (host and sourcetype) for events from HEC local stanza for each token</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369075#M67020</link>
      <description>&lt;P&gt;You should be able to override source and define sourcetype for HEC during configuration I know for sure. I don't believe you can for host. You should also be able to override fields using props and transforms at the indexers.&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;original sourcetype&amp;gt;]
TRANSFORMS-force_host = force_host
TRANSFORMS-force_source = force_source
TRANSFORMS-force_sourcetype=force_sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[force_host]
DEST_KEY=MetaData:Host
FORMAT = &amp;lt;your_host&amp;gt;

[force_source]
DEST_KEY=MetaData:Source
FORMAT = &amp;lt;your_source&amp;gt;

[force_sourcetype]
DEST_KEY=MetaData:Sourcetype
FORMAT = &amp;lt;your_sourcetype&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only thing I am unsure of is Splunk's order of operations. If it changes the sourcetype first, would it no longer see that sourcetype for the event and skip the host and source override? I would have to test but, if so, you should be able to just create a new stanza for the new sourcetype.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Data/Advancedsourcetypeoverrides"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Data/Advancedsourcetypeoverrides&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:46:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369075#M67020</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-08-14T19:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to force to set certain fields (host and sourcetype) for events from HEC local stanza for each token</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369076#M67021</link>
      <description>&lt;P&gt;In HEC configs, source/sourcetype settings come under the "per-token" settings: &lt;A href="http://dev.splunk.com/view/event-collector/SP-CAAAE6Q"&gt;http://dev.splunk.com/view/event-collector/SP-CAAAE6Q&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 19:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369076#M67021</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-08-14T19:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to force to set certain fields (host and sourcetype) for events from HEC local stanza for each token</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369077#M67022</link>
      <description>&lt;P&gt;you are right about HEC configuration if sourcetype, host and over fields are not defined in event.&lt;BR /&gt;
But if sender define this fields, he will override valued defined in inputs.conf.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-force-to-set-certain-fields-host-and-sourcetype-for/m-p/369077#M67022</guid>
      <dc:creator>gots</dc:creator>
      <dc:date>2017-08-14T20:07:34Z</dc:date>
    </item>
  </channel>
</rss>

