<?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 Override host and sourcetype value with event data in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745922#M22225</link>
    <description>&lt;P&gt;Hello everyone. I'm trying to set&amp;nbsp;&lt;STRONG&gt;host&lt;/STRONG&gt; and &lt;STRONG&gt;sourcetype&lt;/STRONG&gt; values with event data. The result is that, the sourcetype is overridden as expected, while the host value is NOT.&lt;/P&gt;&lt;P&gt;By applying the following tranforms.conf and props.conf, I expect that&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The sourcetype is overridden from &lt;STRONG&gt;default:log&lt;/STRONG&gt; to &lt;STRONG&gt;mysp&lt;/STRONG&gt;(which works as expected).&lt;/LI&gt;&lt;LI&gt;Then, for events with sourcetype &lt;STRONG&gt;mysp&lt;/STRONG&gt;, override the host value with my event data using regex extraction(which didn't work).&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It's making me confused. Wondering why it didn't work out for host field. Hopefully someone would kindly help me out here. Thanks.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;transforms.conf&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;[sourcetype_transform]&lt;BR /&gt;SOURCE_KEY = _raw&lt;BR /&gt;REGEX = &amp;lt;my_regex&amp;gt;&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;FORMAT = sourcetype::mysp&lt;BR /&gt;&lt;BR /&gt;[host_transform]&lt;BR /&gt;REGEX = &amp;lt;my_regex&amp;gt;&lt;BR /&gt;FORMAT = host::$1&lt;BR /&gt;DEST_KEY = MetaData:Host&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;props.conf&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;[default:log]&lt;BR /&gt;TRANSFORMS-force_sourcetype = sourcetype_transform&lt;BR /&gt;&lt;BR /&gt;[mysp]&lt;BR /&gt;TRANSFORMS-force_host = host_transform&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 May 2025 04:36:16 GMT</pubDate>
    <dc:creator>JohnSmith123</dc:creator>
    <dc:date>2025-05-12T04:36:16Z</dc:date>
    <item>
      <title>Override host and sourcetype value with event data</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745922#M22225</link>
      <description>&lt;P&gt;Hello everyone. I'm trying to set&amp;nbsp;&lt;STRONG&gt;host&lt;/STRONG&gt; and &lt;STRONG&gt;sourcetype&lt;/STRONG&gt; values with event data. The result is that, the sourcetype is overridden as expected, while the host value is NOT.&lt;/P&gt;&lt;P&gt;By applying the following tranforms.conf and props.conf, I expect that&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The sourcetype is overridden from &lt;STRONG&gt;default:log&lt;/STRONG&gt; to &lt;STRONG&gt;mysp&lt;/STRONG&gt;(which works as expected).&lt;/LI&gt;&lt;LI&gt;Then, for events with sourcetype &lt;STRONG&gt;mysp&lt;/STRONG&gt;, override the host value with my event data using regex extraction(which didn't work).&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It's making me confused. Wondering why it didn't work out for host field. Hopefully someone would kindly help me out here. Thanks.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;transforms.conf&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;[sourcetype_transform]&lt;BR /&gt;SOURCE_KEY = _raw&lt;BR /&gt;REGEX = &amp;lt;my_regex&amp;gt;&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;FORMAT = sourcetype::mysp&lt;BR /&gt;&lt;BR /&gt;[host_transform]&lt;BR /&gt;REGEX = &amp;lt;my_regex&amp;gt;&lt;BR /&gt;FORMAT = host::$1&lt;BR /&gt;DEST_KEY = MetaData:Host&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;props.conf&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;[default:log]&lt;BR /&gt;TRANSFORMS-force_sourcetype = sourcetype_transform&lt;BR /&gt;&lt;BR /&gt;[mysp]&lt;BR /&gt;TRANSFORMS-force_host = host_transform&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 04:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745922#M22225</guid>
      <dc:creator>JohnSmith123</dc:creator>
      <dc:date>2025-05-12T04:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Override host and sourcetype value with event data</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745925#M22226</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/310085"&gt;@JohnSmith123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ensure that your regex in host_transform correctly matches the part of the event data you want to extract as the host. You can test your regex separately to confirm it captures the desired value.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;please provide:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;The actual &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;REGEX&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; used in &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;host_transform&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt; and &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;sourcetype_transform&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;A sample of the raw event data (&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;_raw&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Details about where the configurations are deployed (e.g., heavy forwarder).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 May 2025 05:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745925#M22226</guid>
      <dc:creator>kiran_panchavat</dc:creator>
      <dc:date>2025-05-12T05:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Override host and sourcetype value with event data</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745933#M22231</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/310085"&gt;@JohnSmith123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont think you get two-bites of the props.conf cherry when changing a sourcetype name, instead you need to apply your&amp;nbsp;host_transform to the "default:log" sourcetype rather than the new sourcetype name.&lt;/P&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;== props.conf == 
[default:log]
TRANSFORMS-force_sourcetype = sourcetype_transform
TRANSFORMS-force_host = host_transform

== transforms.conf ==
[sourcetype_transform]
SOURCE_KEY = _raw
REGEX = &amp;lt;my_regex&amp;gt;
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::mysp

[host_transform]
REGEX = &amp;lt;my_regex&amp;gt;
FORMAT = host::$1
DEST_KEY = MetaData:Host&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":glowing_star:"&gt;🌟&lt;/span&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Did this answer help you?&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;If so, please consider:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Adding karma to show it was useful&lt;/LI&gt;&lt;LI&gt;Marking it as the solution if it resolved your issue&lt;/LI&gt;&lt;LI&gt;Commenting if you need any clarification&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Your feedback encourages the volunteers in this community to continue contributing&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 06:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745933#M22231</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2025-05-12T06:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Override host and sourcetype value with event data</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745935#M22232</link>
      <description>&lt;P&gt;If I understand you correctly, you're rewriting sourcetype to mysp and then expect Splunk to apply transforms define for that sourcetype to the events further down the ingestion pipeline. It doesn't work that way (but it's a common expectation, I myself thought it did a few years ago).&lt;/P&gt;&lt;P&gt;Splunk decides at the beginning of the pipeline which settings apply to sourcetype/source/host triple and subsequent rewrites to those fields do not change it - the event goes through ingestion pipeline using the originally decided transforms.&lt;/P&gt;&lt;P&gt;The only way to "switch" to another sourcetype is to use CLONE_SOURCETYPE (but then you have to handle the original copy of the event as well).&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 06:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745935#M22232</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-05-12T06:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Override host and sourcetype value with event data</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745960#M22234</link>
      <description>&lt;P&gt;Yes, this is exactly what I expected. Thank you for confirming the way it works.&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 11:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745960#M22234</guid>
      <dc:creator>JohnSmith123</dc:creator>
      <dc:date>2025-05-12T11:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Override host and sourcetype value with event data</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745961#M22235</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/170906"&gt;@livehybrid&lt;/a&gt;&amp;nbsp;. It works. Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 11:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Override-host-and-sourcetype-value-with-event-data/m-p/745961#M22235</guid>
      <dc:creator>JohnSmith123</dc:creator>
      <dc:date>2025-05-12T11:45:38Z</dc:date>
    </item>
  </channel>
</rss>

