<?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: Change IPs in syslog to names in csv file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43940#M8204</link>
    <description>&lt;P&gt;The easiest solution may not be a "Splunk" one at all.  Put your router IPs in /etc/hosts on the machine receiving the syslog.  Let it write the proper host names into the events as they are received.  &lt;/P&gt;

&lt;P&gt;I am making an assumption here that you are using syslog-ng or rsyslog or something as the UDP receiver and letting Splunk read its input files.  If you're using Splunk's own UDP receiver, you may need to set:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;connection_host = dns
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for the appropriate stanza in inputs.conf.&lt;/P&gt;</description>
    <pubDate>Fri, 04 May 2012 23:19:59 GMT</pubDate>
    <dc:creator>dwaddle</dc:creator>
    <dc:date>2012-05-04T23:19:59Z</dc:date>
    <item>
      <title>Change IPs in syslog to names in csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43938#M8202</link>
      <description>&lt;P&gt;I have been trying to learn where to begin with this, but I'm still struggling three days later, so I figured I would ask here.&lt;/P&gt;

&lt;P&gt;I am trying to display OSPF and PIM neighbor tables that I have sent to syslog, but instead of displaying them with their IP addresses, I would like to use names I have in a csv file.  &lt;/P&gt;

&lt;P&gt;format of the csv file I think should be something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ip, hostname
43.25.65.3, Router1
10.127.99.213, Router2
76.99.5.244, Router3
172.16.1.1, Router4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the syslog output from the router as it's shown in Splunk:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;May  3 16:18:07 172.16.8.81 451: *Mar  1 00:32:24.691: %HA_EM-6-LOG: sys: 

May  3 16:18:07 172.16.8.81 452: 

May  3 16:18:07 172.16.8.81 453: Neighbor ID     Pri   State           Dead Time   Address         Interface

May  3 16:18:07 172.16.8.81 454: 43.25.65.3        1   FULL/BDR        00:00:35    172.16.1.1      FastEthernet0/0

May  3 16:18:07 172.16.8.81 455: 76.99.5.244       1   FULL/BDR        00:00:38    10.127.99.213   FastEthernet1/0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't know how to go about actually applying this stuff to the syslog output.  If anyone can suggest a simple way to accomplish this I would be so happy! &lt;/P&gt;

&lt;P&gt;If there is an easier way to do this (No DHCP) then please suggest.  Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 18:38:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43938#M8202</guid>
      <dc:creator>lazermissile</dc:creator>
      <dc:date>2012-05-04T18:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change IPs in syslog to names in csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43939#M8203</link>
      <description>&lt;P&gt;You'll first need to make sure that you're capturing the dotted IP address from the log lines as a field.  Let's say you've set it up and have a field called &lt;EM&gt;host_ip&lt;/EM&gt;.  (The &lt;EM&gt;host&lt;/EM&gt; field created by Splunk may or may not reflect the IP address of the router device, depending upon whether or not you have the data going over a syslog channel directly into Splunk, or whether there is a syslog receiver and Splunk Forwarder in between....)&lt;/P&gt;

&lt;P&gt;Once you have a field containing the dotted IP, you're talking about a lookup.  Use the Manager &amp;gt; Lookups section to first create a file (with the contents you've provided), then create a lookup definition, to be able to refer to it by name.  Let's say you called the file &lt;EM&gt;router_ips.csv&lt;/EM&gt;, and then created a lookup definition &lt;EM&gt;router_lookup&lt;/EM&gt; to refer to that file.  &lt;/P&gt;

&lt;P&gt;Now, in the search bar, you could do:  &lt;CODE&gt;&amp;lt; your search &amp;gt; | lookup router_lookup ip AS host_ip OUTPUT hostname&lt;/CODE&gt;.  At this point the &lt;EM&gt;hostname&lt;/EM&gt; field would contain a string like 'Router4'.&lt;/P&gt;

&lt;P&gt;You can further configure this lookup (again, via the Manager) to be automatic, and not require the extra "lookup" step described above.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 20:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43939#M8203</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-05-04T20:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Change IPs in syslog to names in csv file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43940#M8204</link>
      <description>&lt;P&gt;The easiest solution may not be a "Splunk" one at all.  Put your router IPs in /etc/hosts on the machine receiving the syslog.  Let it write the proper host names into the events as they are received.  &lt;/P&gt;

&lt;P&gt;I am making an assumption here that you are using syslog-ng or rsyslog or something as the UDP receiver and letting Splunk read its input files.  If you're using Splunk's own UDP receiver, you may need to set:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;connection_host = dns
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;for the appropriate stanza in inputs.conf.&lt;/P&gt;</description>
      <pubDate>Fri, 04 May 2012 23:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Change-IPs-in-syslog-to-names-in-csv-file/m-p/43940#M8204</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-05-04T23:19:59Z</dc:date>
    </item>
  </channel>
</rss>

