<?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: Grabbing IPs from unstructure logs? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20781#M3052</link>
    <description>&lt;P&gt;This worked for me after changing the beginning of the rex to "\w+\s+" , using this against dnmasq-dhcp syslog from Tomato firmware.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jan 2017 13:52:08 GMT</pubDate>
    <dc:creator>jspears</dc:creator>
    <dc:date>2017-01-08T13:52:08Z</dc:date>
    <item>
      <title>Grabbing IPs from unstructure logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20778#M3049</link>
      <description>&lt;P&gt;I'm a splunk beginner, and have been able to do all kinds of interesting things with my logs that are structured as attribute=value pairs.   The attribute names are discovered and I can graph the top 10 occurrences, etc.&lt;/P&gt;

&lt;P&gt;What I'm having a harder time with is my logs that do not have attribute names built in.  For example, my DHCP logs, I want to analyze IP address assignments, unusual MAC addresses, hostname to MAC or IP, etc.   I've had some success with 'rex' on other logs, but not with these.  Is rex the best/easiest way?  Other suggestions for learning the fields I want?&lt;/P&gt;

&lt;P&gt;Jul 31 10:53:52 dnsmasq-dhcp[24852]: DHCPACK(br0) 10.31.11.164 00:26:08:68:6c:8a&lt;/P&gt;

&lt;P&gt;Jul 31 10:53:52 dnsmasq-dhcp[24852]: DHCPREQUEST(br0) 10.31.11.164 00:26:08:68:6c:8a&lt;/P&gt;

&lt;P&gt;Jul 31 10:24:32 dnsmasq-dhcp[24852]: DHCPACK(br0) 10.31.11.249 00:18:dd:33:0e:f4 HDHR-2140DF1C&lt;/P&gt;

&lt;P&gt;Jul 31 08:30:55 dnsmasq-dhcp[24852]: DHCPACK(br0) 10.31.11.107 00:23:6c:bb:f4:15 wifi-extreme&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 18:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20778#M3049</guid>
      <dc:creator>jharris1111</dc:creator>
      <dc:date>2013-07-31T18:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing IPs from unstructure logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20779#M3050</link>
      <description>&lt;P&gt;Try this Regex in your rex command:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search | rex field=_raw "\w+\s\d+\s\d+:\d+:\d+\s(?&amp;lt;process_name&amp;gt;[^\[]*)\[(?&amp;lt;pid&amp;gt;\d+)\]:\s(?&amp;lt;action&amp;gt;[^\(]*)\((?&amp;lt;interface&amp;gt;[^\)]*)\)\s(?&amp;lt;src_ip&amp;gt;[^\s]*)\s(?&amp;lt;src_mac&amp;gt;[^\s]*)\s(?&amp;lt;src_host&amp;gt;[^\s]*)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You can also do it automatically in props/transforms.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;props.conf&lt;BR /&gt;
[sourcetypeForDHCP]&lt;BR /&gt;
REPORT-0auto_fields = dhcp-field-ext&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;transforms.conf&lt;BR /&gt;
[dhcp-field-ext]&lt;BR /&gt;
REGEX = \w+\s\d+\s\d+:\d+:\d+\s([^\[]*)\[(\d+)\]:\s([^\(]*)\(([^\)]*)\)\s([^\s]*)\s([^\s]*)\s([^\s]*)&lt;BR /&gt;
FORMAT = process_name::$1 pid::$2 action::$3 interface::$4 src_ip::$5 src_mac::$6 src_host::$7&lt;BR /&gt;
MV_ADD = true&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 18:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20779#M3050</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-31T18:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing IPs from unstructure logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20780#M3051</link>
      <description>&lt;P&gt;Thanks, alacercogitatus.&lt;/P&gt;

&lt;P&gt;This worked great and I was able to re-use this solution for some similar analysis.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2013 22:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20780#M3051</guid>
      <dc:creator>jharris1111</dc:creator>
      <dc:date>2013-08-01T22:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Grabbing IPs from unstructure logs?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20781#M3052</link>
      <description>&lt;P&gt;This worked for me after changing the beginning of the rex to "\w+\s+" , using this against dnmasq-dhcp syslog from Tomato firmware.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 13:52:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Grabbing-IPs-from-unstructure-logs/m-p/20781#M3052</guid>
      <dc:creator>jspears</dc:creator>
      <dc:date>2017-01-08T13:52:08Z</dc:date>
    </item>
  </channel>
</rss>

