<?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 modify host and sourcetype at the same time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593068#M103793</link>
    <description>&lt;P&gt;That is true it executes in alphabetical order.&lt;/P&gt;&lt;P&gt;But in your case order doesn't matter.&lt;/P&gt;&lt;P&gt;Order only matters if you are extracting some field that you want to later override by some other TRANSFORMS.&lt;/P&gt;&lt;P&gt;Here you have two different transforms one updating host and the other updating sourcetype, so regardless of which executes first or second, you will have both updated.&lt;/P&gt;&lt;P&gt;-----------&lt;BR /&gt;I hope I explained to you when orders will be useful. And kindly accept the answer if it resolves your issue.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2022 08:01:55 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2022-04-08T08:01:55Z</dc:date>
    <item>
      <title>How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593026#M103785</link>
      <description>&lt;P&gt;When using HF to collect logs on the cloud，&lt;/P&gt;&lt;P&gt;Because the add-on used cannot set host，&lt;/P&gt;&lt;P&gt;So the host of the data is the name of HF，&lt;/P&gt;&lt;P&gt;but it needs to reflect that the data comes from an impassable environment，&lt;/P&gt;&lt;P&gt;And the same data type uses the same sourcetype.&lt;/P&gt;&lt;P&gt;At present, the way I use is&amp;nbsp;First, use different sourcetypes to access data&amp;nbsp;&lt;/P&gt;&lt;P&gt;At this time, they have the same host （HF name）&lt;/P&gt;&lt;P&gt;then, I use props and transforms to modify their host&lt;/P&gt;&lt;P&gt;and Change their sourcetype to the same one&lt;/P&gt;&lt;P&gt;the question is modify host and change sourcetype&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only one will take effect.&lt;/P&gt;&lt;P&gt;Is there a way to modify the host first and then modify the sourcetype？&lt;/P&gt;&lt;P&gt;Or something better ？&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 03:33:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593026#M103785</guid>
      <dc:creator>legaldan</dc:creator>
      <dc:date>2022-04-08T03:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593039#M103787</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232922"&gt;@legaldan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the TRANSFORMS will get executed after the host/source/sourcetype stanzas are decided. And the process happens only once.&lt;/P&gt;&lt;P&gt;So for example, if you want to change the host and based on the new hostname you want to modify sourcetype then it's not possible.&lt;/P&gt;&lt;P&gt;But you can write the TRANSFORMS on old sourcetype/source/host and write your REGEX accordingly.&lt;/P&gt;&lt;P&gt;Kindly provide sample examples of source/sourcetype/host values if you want help with the configuration.&lt;/P&gt;&lt;P&gt;----&lt;BR /&gt;I hope this helps!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 04:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593039#M103787</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-08T04:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593046#M103789</link>
      <description>&lt;P&gt;Thank you for your reply！&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;examples&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;MetaData：&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;index=test&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;host=hf_splunk&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&amp;nbsp;sourcetype=tomcat_prod&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;props.conf&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;[tomcat_prod]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;TRANSFORMS =prod_changehost&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;TRANSFORMS =tomcat_changesourcetype&lt;/FONT&gt;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;P&gt;[prod_changehost]&lt;BR /&gt;REGEX = .*&lt;BR /&gt;FORMAT = host::hostname_prod&lt;BR /&gt;DEST_KEY = MetaData:Host&lt;/P&gt;&lt;P&gt;[tomcat_changesourcetype]&lt;BR /&gt;REGEX = .*&lt;BR /&gt;FORMAT = sourcetype::tomcat:access&lt;BR /&gt;DEST_KEY = MetaData:Sourcetype&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected results：&lt;/P&gt;&lt;P&gt;index=test&amp;nbsp;&lt;/P&gt;&lt;P&gt;host=hf_splunk → host=hostname_prod&lt;/P&gt;&lt;P&gt;sourcetype=tomcat_prod → sourcetype=tomcat_access&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 05:29:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593046#M103789</guid>
      <dc:creator>legaldan</dc:creator>
      <dc:date>2022-04-08T05:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593047#M103790</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232922"&gt;@legaldan&lt;/a&gt;&amp;nbsp;- Use class names with TRANSFORMS to specify they are different attributes.&lt;/P&gt;&lt;P&gt;props.conf&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[tomcat_prod]
TRANSFORMS-for_host_change = prod_changehost
TRANSFORMS-for_sourcetype_change = tomcat_changesourcetype&lt;/LI-CODE&gt;&lt;P&gt;transforms.conf remains as you have.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 05:35:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593047#M103790</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-08T05:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593052#M103791</link>
      <description>&lt;P class="lia-align-left"&gt;I know Splunk executes code in alphabetical order （A-Z）&lt;/P&gt;&lt;P class="lia-align-left"&gt;and&amp;nbsp;I named the code to modify the &lt;STRONG&gt;host&lt;/STRONG&gt; as the letter at the &lt;STRONG&gt;top&lt;/STRONG&gt; of the sort&lt;/P&gt;&lt;P class="lia-align-left"&gt;Modify the code of &lt;STRONG&gt;sourcetype&lt;/STRONG&gt; and name it as the letter at the &lt;STRONG&gt;end&lt;/STRONG&gt; of the sorting&lt;/P&gt;&lt;P class="lia-align-left"&gt;It seems to be working now&lt;/P&gt;&lt;P class="lia-align-left"&gt;I'll do more tests. Thank you for your support！&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 06:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593052#M103791</guid>
      <dc:creator>legaldan</dc:creator>
      <dc:date>2022-04-08T06:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593057#M103792</link>
      <description>&lt;P&gt;My colleague gave me a better way to execute the code from left to right&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;transforms.conf&lt;/P&gt;&lt;P&gt;TRANSFORMS = A,B&lt;/P&gt;&lt;P&gt;In this way, execute A first and then B&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 06:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593057#M103792</guid>
      <dc:creator>legaldan</dc:creator>
      <dc:date>2022-04-08T06:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify host and sourcetype at the same time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593068#M103793</link>
      <description>&lt;P&gt;That is true it executes in alphabetical order.&lt;/P&gt;&lt;P&gt;But in your case order doesn't matter.&lt;/P&gt;&lt;P&gt;Order only matters if you are extracting some field that you want to later override by some other TRANSFORMS.&lt;/P&gt;&lt;P&gt;Here you have two different transforms one updating host and the other updating sourcetype, so regardless of which executes first or second, you will have both updated.&lt;/P&gt;&lt;P&gt;-----------&lt;BR /&gt;I hope I explained to you when orders will be useful. And kindly accept the answer if it resolves your issue.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 08:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-host-and-sourcetype-at-the-same-time/m-p/593068#M103793</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-08T08:01:55Z</dc:date>
    </item>
  </channel>
</rss>

