<?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: Replace/rename a host name with another host name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46054#M10988</link>
    <description>&lt;P&gt;Maybe try creating an alias for the field? See &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addaliasestofields"&gt;Create aliases for fields&lt;/A&gt; in the Knowledge Manager Manual.&lt;/P&gt;</description>
    <pubDate>Tue, 08 May 2012 16:52:10 GMT</pubDate>
    <dc:creator>ChrisG</dc:creator>
    <dc:date>2012-05-08T16:52:10Z</dc:date>
    <item>
      <title>Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46053#M10987</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to rename/replace host name (ip-10-0-0-4) with host name (XXXXXX-GOC-MON-01).  I found this similar issue but it is slightly different and doesn't work for me:&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="http://splunk-base.splunk.com/answers/1673/hostname-rename-using-transforms"&gt;host rename using TRANSFORMS&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Specifically looking to extract from a syslog sourcetype the word or IP directly after HH:MM:SS and replace it with a host name.&lt;/P&gt;

&lt;P&gt;Apr 25 19:11:38 &lt;STRONG&gt;ip-10-0-0-4&lt;/STRONG&gt; kernel: Kernel logging (proc) stopped.&lt;BR /&gt;&lt;BR /&gt;
Apr 25 19:11:38 &lt;STRONG&gt;192.168.1.1&lt;/STRONG&gt; kernel: Kernel logging (proc) stopped.&lt;/P&gt;

&lt;P&gt;I have absolutely no experience with regex but tried putting some things together from tutorials.  I am trying this regex to capture the data directly after HH:MM:SS&lt;BR /&gt;&lt;BR /&gt;
&lt;STRONG&gt;(?&amp;lt;=([0-1]\d|2[0-3]):([0-5]\d):([0-5]\d)&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;transforms.conf               
[syslog_host_rename]  
REGEX = (?&amp;lt;=([0-1]\d|2[0-3]):([0-5]\d):([0-5]\d))  
DEST_KEY = MetaData:Host
FORMAT = host::XXXXXX-GOC-MON-01 

props.conf
[host::XXXXXXX-GOC-MON-01]
TRANSFORMS-host_rename = syslog_host_rename
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hopefully this makes my goals a litte more clear.  Any suggestions would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 15:56:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46053#M10987</guid>
      <dc:creator>Adrian</dc:creator>
      <dc:date>2012-05-08T15:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46054#M10988</link>
      <description>&lt;P&gt;Maybe try creating an alias for the field? See &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Addaliasestofields"&gt;Create aliases for fields&lt;/A&gt; in the Knowledge Manager Manual.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 16:52:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46054#M10988</guid>
      <dc:creator>ChrisG</dc:creator>
      <dc:date>2012-05-08T16:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46055#M10989</link>
      <description>&lt;P&gt;True, the original field is not removed. I understood from your question that renaming would be acceptable. Apparently not? Other options for renaming: you can use the replace command in your search, set the host variable in inputs.conf, or rewrite it with transforms and/or props.conf. I don't know if you can actually replace the value completely.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 17:03:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46055#M10989</guid>
      <dc:creator>ChrisG</dc:creator>
      <dc:date>2012-05-08T17:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46056#M10990</link>
      <description>&lt;P&gt;can you paste sample data and the props/transforms configs you tried?&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 17:03:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46056#M10990</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2012-05-08T17:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46057#M10991</link>
      <description>&lt;P&gt;It's hard to know if this is about data coming from a forwarder with a value other than what you want in the default inputs.conf, or if it's data from a device where you can't control the values used, or some other scenario.  The best remedy depends upon the scenario.   Generically, at search time, there isn't a way to permanently modify the data in the index.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 17:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46057#M10991</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2012-05-08T17:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46058#M10992</link>
      <description>&lt;P&gt;Using a host tag would also work for some cases.  Again, this isn't replacing the original value of &lt;CODE&gt;host=&lt;/CODE&gt; but supplementing it - allowing you to search by the tag, which takes on the value of all of the different names you know the host as, without changing the original stored value of &lt;CODE&gt;host&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;Splunk does not provide a way to change that which has already been indexed.  If it was indexed with &lt;CODE&gt;host=foo&lt;/CODE&gt; then it will always be &lt;CODE&gt;host=foo&lt;/CODE&gt; until such a time as that data is purged per your index retention policies.&lt;/P&gt;

&lt;P&gt;Using the props/transforms approach you linked to above will let you (at index time) change the value of host= for newly arriving events.  But, it can't do anything for prior indexed events.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 17:35:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46058#M10992</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-05-08T17:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Replace/rename a host name with another host name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46059#M10993</link>
      <description>&lt;P&gt;Thanks for your input I wasn't completely clear on my requirements.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 18:49:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Replace-rename-a-host-name-with-another-host-name/m-p/46059#M10993</guid>
      <dc:creator>Adrian</dc:creator>
      <dc:date>2012-05-08T18:49:20Z</dc:date>
    </item>
  </channel>
</rss>

