<?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 convert computer name to host name? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209809#M61353</link>
    <description>&lt;P&gt;Unfortunately, host_regex only applies to the source path not arbitrary log contents.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2016 14:28:42 GMT</pubDate>
    <dc:creator>twinspop</dc:creator>
    <dc:date>2016-04-20T14:28:42Z</dc:date>
    <item>
      <title>How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209804#M61348</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;We have environment where &lt;/P&gt;

&lt;P&gt;windows events are forwarded =&amp;gt;  windows Event Collector &lt;BR /&gt;
Windows Event Collector =&amp;gt; Splunk indexer &lt;/P&gt;

&lt;P&gt;Spunk forwarder has been installed only on Collector server.&lt;/P&gt;

&lt;P&gt;In Splunk host name for all windows events is windows event Collector.&lt;/P&gt;

&lt;P&gt;How do we make hostname = computer-name&lt;/P&gt;

&lt;P&gt;is there a way to do this?&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;BR /&gt;
.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 03:51:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209804#M61348</guid>
      <dc:creator>AKG</dc:creator>
      <dc:date>2016-04-20T03:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209805#M61349</link>
      <description>&lt;P&gt;Can you provide an Event example?&lt;BR /&gt;
Mostly you can do it with this setting in your &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf"&gt;inputs.conf&lt;/A&gt;:&lt;/P&gt;

&lt;P&gt;host_regex = [regular expression]  &lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 07:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209805#M61349</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-04-20T07:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209806#M61350</link>
      <description>&lt;P&gt;Could you provide a bit more detail with examples of what your data looks like currently and how you would like it to look? &lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 09:11:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209806#M61350</guid>
      <dc:creator>rusty009</dc:creator>
      <dc:date>2016-04-20T09:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209807#M61351</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Option A) Search time extraction:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search here
| eval host = Computer-Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option B) Iindex time:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[host::&amp;lt;host&amp;gt;]
TRANSFORMS-renameHost = rename_host_from_Computer-Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rename_host_from_Computer-Name]
REGEX = [regex that captures your Computer-Name]
DEST_KEY = MetaData:Host
FORMAT = host::$1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More info here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Overridedefaulthostassignments"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Overridedefaulthostassignments&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option C) Use a host tag:&lt;/STRONG&gt; &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Tagthehostfield"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Tagthehostfield&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope that helps&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 11:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209807#M61351</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-20T11:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209808#M61352</link>
      <description>&lt;P&gt;This is what we use with the Windows Event Collection service.  We put the WEC server hostname into a field called forwarder (so we know which collector sent the data) and then set the host field according to the ComputerName value in the Windows event.  &lt;/P&gt;

&lt;P&gt;In props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[(?:::){0}WinEventLog:...]
TRANSFORMS-FixWinEventLogHost = WinEventLog-SetForwarderName,WinEventLog-SetOriginatingHost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WinEventLog-SetForwarderName]
REGEX = ^host::(.*)$
SOURCE_KEY = MetaData:Host
FORMAT = forwarder::$1
WRITE_META = true

[WinEventLog-SetOriginatingHost]
REGEX = (?m)^ComputerName=([^\.\v]++)
FORMAT = host::$1
DEST_KEY = MetaData:Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We run universal forwarders on the WEC servers and deploy this configuration on our indexers.  If you run a heavy forwarder on your WEC server, you should deploy these changes there instead.  If you don't want to capture the forwarder name in a field, just omit the WinEventLog-SetForwarderName portion.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 14:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209808#M61352</guid>
      <dc:creator>Jeremiah</dc:creator>
      <dc:date>2016-04-20T14:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209809#M61353</link>
      <description>&lt;P&gt;Unfortunately, host_regex only applies to the source path not arbitrary log contents.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 14:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209809#M61353</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-04-20T14:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209810#M61354</link>
      <description>&lt;P&gt;Yes you are right. I think the Answer from @javiergn is the best one for this case&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 14:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209810#M61354</guid>
      <dc:creator>PPape</dc:creator>
      <dc:date>2016-04-20T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209811#M61355</link>
      <description>&lt;P&gt;Thank you All for your reply&lt;/P&gt;

&lt;P&gt;All our windows logs are coming from windows collector so when we do the searching e.g. license usage by host all we get is collector's name and amount used. &lt;/P&gt;

&lt;P&gt;for other searches we have to have two searches e.g. for windows computers with "computername = " and for nix with "host= " &lt;/P&gt;

&lt;P&gt;we don't want users need to remember this type differences.&lt;/P&gt;

&lt;P&gt;I will try the example above and come back to you, &lt;/P&gt;

&lt;P&gt;Also Jeremiah (sorry for my lack of regex understanding)&lt;/P&gt;

&lt;P&gt;Why do we use [(?:::){0}WinEventLog:...] ? what is the advantage over using tags like over  [host::]?&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 04:22:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209811#M61355</guid>
      <dc:creator>AKG</dc:creator>
      <dc:date>2016-04-21T04:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert computer name to host name?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209812#M61356</link>
      <description>&lt;P&gt;Thank you Jeremiah&lt;/P&gt;

&lt;P&gt;This did exactly what we wanted to do.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 01:09:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-computer-name-to-host-name/m-p/209812#M61356</guid>
      <dc:creator>AKG</dc:creator>
      <dc:date>2016-04-22T01:09:01Z</dc:date>
    </item>
  </channel>
</rss>

