<?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 Resolve IP to Host in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28392#M177815</link>
    <description>&lt;P&gt;I am creating a failed login report from WMI security log entires. My temporary search command looks like:&lt;/P&gt;

&lt;PRE&gt;
sourcetype="WMI*Security" Type="Audit Failure" Account_Name=* | stats values(Account_Name) values(Client_Address) values(Client_Port) by _time
&lt;/PRE&gt;

&lt;P&gt;Client_Address values are IP addresses, and I would like them to be displayed as the host name. How can I accomplish that?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;FYI&lt;/STRONG&gt;, I have already read the article on Lookup command to resolve IP to Host. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.2/Knowledge/Addfieldsfromexternaldatasources"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.2/Knowledge/Addfieldsfromexternaldatasources&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And I am having trouble understanding how to set it up and make use of it in my search. Really appreciate any help.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2013 21:09:07 GMT</pubDate>
    <dc:creator>lain179</dc:creator>
    <dc:date>2013-05-08T21:09:07Z</dc:date>
    <item>
      <title>Resolve IP to Host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28392#M177815</link>
      <description>&lt;P&gt;I am creating a failed login report from WMI security log entires. My temporary search command looks like:&lt;/P&gt;

&lt;PRE&gt;
sourcetype="WMI*Security" Type="Audit Failure" Account_Name=* | stats values(Account_Name) values(Client_Address) values(Client_Port) by _time
&lt;/PRE&gt;

&lt;P&gt;Client_Address values are IP addresses, and I would like them to be displayed as the host name. How can I accomplish that?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;FYI&lt;/STRONG&gt;, I have already read the article on Lookup command to resolve IP to Host. &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.2/Knowledge/Addfieldsfromexternaldatasources"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.2/Knowledge/Addfieldsfromexternaldatasources&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And I am having trouble understanding how to set it up and make use of it in my search. Really appreciate any help.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2013 21:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28392#M177815</guid>
      <dc:creator>lain179</dc:creator>
      <dc:date>2013-05-08T21:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve IP to Host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28393#M177816</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Addfieldsfromexternaldatasources#Example_of_external_fields_lookup" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Addfieldsfromexternaldatasources#Example_of_external_fields_lookup&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If the docs are unclear or need to be improved, don't hesitate to submit feedback at the bottom of each docs page!  In the meantime, maybe this will add some clarity to this process:&lt;/P&gt;

&lt;P&gt;You want to add this stanza to $SPLUNK_HOME/etc/system/local/transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[dnsLookup]
external_cmd = external_lookup.py host ip
fields_list = host, ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This defines the lookup called "dnsLookup" which we can now tie to a specific sourcetype in $SPLUNK_HOME/etc/system/local/props.conf as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WMI*Security]
LOOKUP-rdns = dnsLookup ip AS Client_Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note that this stanza has been renamed from the docs to reference the sourcetype you're interested in performing the lookup on (WMI*Security) and will create a new field called hostname that contains the rdns lookup value.&lt;/P&gt;

&lt;P&gt;Restart Splunk and you should be all set.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:52:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28393#M177816</guid>
      <dc:creator>emechler_splunk</dc:creator>
      <dc:date>2020-09-28T13:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve IP to Host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28394#M177817</link>
      <description>&lt;P&gt;I did that, and what's next? How do I use that in my search to transform IP to host name? When I do "lookup dnsLoopup Client_Address", it gave me an error saying 'dnsLookup' does not exist.&lt;/P&gt;

&lt;P&gt;&lt;PRE&gt;&lt;BR /&gt;
sourcetype="WMI*Security" Type="Audit Failure" Account_Name=* | stats values(Account_Name) values(Client_Address) values(Client_Port) by _time | lookup dnsLookup Client_Address&lt;BR /&gt;
&lt;PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28394#M177817</guid>
      <dc:creator>lain179</dc:creator>
      <dc:date>2020-09-28T13:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve IP to Host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28395#M177818</link>
      <description>&lt;P&gt;Never, I got it to work with file lookup.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2013 17:21:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28395#M177818</guid>
      <dc:creator>lain179</dc:creator>
      <dc:date>2013-05-09T17:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve IP to Host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28396#M177819</link>
      <description>&lt;P&gt;Edited the original post to remove the "OUTPUTNEW host AS hostname" part of the lookup; that doesn't appear to be necessary anymore.  You also don't need to add "| lookup dnsLookup Client_Address" to your search; the entry in props.conf makes the lookup automatic.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2013 17:29:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28396#M177819</guid>
      <dc:creator>emechler_splunk</dc:creator>
      <dc:date>2013-05-09T17:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Resolve IP to Host</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28397#M177820</link>
      <description>&lt;P&gt;Does the target need to be an existing extraction?&lt;/P&gt;

&lt;P&gt;For example:&lt;BR /&gt;
LOOKUP-rdns = dnsLookup ip AS Client_Address&lt;/P&gt;

&lt;P&gt;Does "Client_Address" have to be an existing field that's extracted (and presumably populated with IP addresses) -- or is this a new field that is created?&lt;/P&gt;

&lt;P&gt;(in either case, still not getting this to work...)&lt;BR /&gt;
/opt/splunk/etc/system/local/transforms.conf&lt;BR /&gt;
   [dnsLookup]&lt;BR /&gt;
    external_cmd = external_lookup.py host ip&lt;BR /&gt;
    fields_list = host, ip&lt;/P&gt;

&lt;P&gt;/opt/splunk/etc/system/local/props.conf&lt;BR /&gt;
    [access_log-too_small]&lt;BR /&gt;
    LOOKUP-rdns = dnsLookup ip AS Client_Address  &lt;/P&gt;

&lt;P&gt;Also tried "source_ip" (v.s. Client_Address) because it's an existing extraction that's populated with IP addresses, yes appearing as the sourcetype "access_log-too_small".&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:52:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Resolve-IP-to-Host/m-p/28397#M177820</guid>
      <dc:creator>Michael</dc:creator>
      <dc:date>2020-09-28T14:52:52Z</dc:date>
    </item>
  </channel>
</rss>

