<?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: Regex for arpwatch extractions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119638#M32115</link>
    <description>&lt;P&gt;Thank you all for you answers.  I really appreciate all the help.  I have fought my way through regexes before but if you don't do it every day it can be frustrating to pick it all up again.  The samples you have provided me are a great start.  Once I get all my fields properly defined I will post what I have.&lt;/P&gt;</description>
    <pubDate>Fri, 04 Apr 2014 13:39:06 GMT</pubDate>
    <dc:creator>ehoward</dc:creator>
    <dc:date>2014-04-04T13:39:06Z</dc:date>
    <item>
      <title>Regex for arpwatch extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119634#M32111</link>
      <description>&lt;P&gt;Does anyone have any field extraction regexes for arpwatch they could share?  I could probably figure it out eventually but regexes are not my idea of fun.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 19:56:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119634#M32111</guid>
      <dc:creator>ehoward</dc:creator>
      <dc:date>2014-04-03T19:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for arpwatch extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119635#M32112</link>
      <description>&lt;P&gt;You could of your data and what you want to extract.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2014 19:58:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119635#M32112</guid>
      <dc:creator>lukejadamec</dc:creator>
      <dc:date>2014-04-03T19:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for arpwatch extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119636#M32113</link>
      <description>&lt;P&gt;Hi ehoward,&lt;/P&gt;

&lt;P&gt;like lukejadamec said sample data are most useful and your needs as well. Nevertheless since arpwatch is nothing else then syslog output and therefore pretty generic you can do some regex-Fu based on this log example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Nov 10 15:59:34 debian arpwatch: new station 192.168.1.2 0:17:9a:a:f6:44 eth0
Nov 10 15:59:34 debian arpwatch: changed station 192.168.1.2 0:17:9a:b:f6:f6 (0:17:9a:a:f6:44)
Nov 10 15:59:34 debian arpwatch: new station 192.168.1.2 0:17:9a:a:f6:44 eth0
Nov 10 15:59:34 debian arpwatch: changed station 192.168.1.2 0:17:9a:b:f6:f6 (0:17:9a:a:f6:44)
Nov 10 15:59:34 debian arpwatch: new station 192.168.1.2 0:17:9a:a:f6:44 eth0
Nov 10 15:59:34 debian arpwatch: changed station 192.168.1.2 0:17:9a:b:f6:f6 (0:17:9a:a:f6:44)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;using above sample use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field="_raw" "\:\s(?&amp;lt;arpwatchStatus&amp;gt;.+station)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to get a new field &lt;CODE&gt;arpwatchStatus&lt;/CODE&gt; containing either &lt;CODE&gt;new station&lt;/CODE&gt; or &lt;CODE&gt;changed station&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Use this :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field="_raw" "\s(?&amp;lt;arpwatchInterface&amp;gt;[a-z]+[0-9])" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to get a new field called &lt;CODE&gt;arpwatchInterface&lt;/CODE&gt; containing in this case &lt;CODE&gt;eth0&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You just learned search time field extraction, so you should know what the field names for the next examples will be and what they will contain:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field="_raw" "new\sstation\s(?&amp;lt;arpwatchNewIP&amp;gt;(\d+\.){3}\d+)\s" | ...
... | rex field="_raw" "new\sstation\s(\d+\.){3}\d+\s(?&amp;lt;arpwatchNewMAC&amp;gt;([0-9a-f]{1,2}[\.:-]){5}([0-9a-f]{1,2}))" | ...
... | rex field="_raw" "changed\sstation\s(?&amp;lt;arpwatchChangedIP&amp;gt;(\d+\.){3}\d+)\s" | ...
... | rex field="_raw" "changed\sstation\s(\d+\.){3}\d+\s(?&amp;lt;arpwatchChangedMAC&amp;gt;([0-9a-f]{1,2}[\.:-]){5}([0-9a-f]{1,2}))" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;field extraction can be setup to happen automatic, take a look &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/Knowledge/Managesearch-timefieldextractions"&gt;at the docs about this&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;hope this helps to get you going ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;PS: if this answer was useful, please tick the tick to mark it answered&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2014 05:49:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119636#M32113</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-04T05:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for arpwatch extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119637#M32114</link>
      <description>&lt;P&gt;given that your record looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Apr  3 23:33:25 splunkiron arpwatch: new station 192.168.1.229 80:ea:96:b8:3:e3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should be able to use this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?:[^\s]+\s+){3}(?&amp;lt;host&amp;gt;[^\s]+)\s+(?&amp;lt;process&amp;gt;[^:]+):\s+(?&amp;lt;message&amp;gt;[^\d]+)(?&amp;lt;dest&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+(?&amp;lt;mac&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you provide some log samples and the fields you'd like extracted, I can be more precise.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2014 05:50:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119637#M32114</guid>
      <dc:creator>sbrant_splunk</dc:creator>
      <dc:date>2014-04-04T05:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for arpwatch extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119638#M32115</link>
      <description>&lt;P&gt;Thank you all for you answers.  I really appreciate all the help.  I have fought my way through regexes before but if you don't do it every day it can be frustrating to pick it all up again.  The samples you have provided me are a great start.  Once I get all my fields properly defined I will post what I have.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2014 13:39:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119638#M32115</guid>
      <dc:creator>ehoward</dc:creator>
      <dc:date>2014-04-04T13:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Regex for arpwatch extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119639#M32116</link>
      <description>&lt;P&gt;You're welcome. Please tick the tick in this case to mark this as answered - thx&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2014 13:43:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-for-arpwatch-extractions/m-p/119639#M32116</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-04T13:43:05Z</dc:date>
    </item>
  </channel>
</rss>

