<?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: Pulling extracts from Snort alerts in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209427#M12062</link>
    <description>&lt;P&gt;Solved myself &lt;CODE&gt;^\d{2}\/\d{2}-\d{2}:\d{2}:\d{2}\.\d{6}\s\s\[\*\*\]\s\[\d{1,3}:\d{2,7}:\d{1,4}\]\s(?P&amp;lt;alert&amp;gt;((\D|\d){15,75})\s)\[\*\*\]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Just goes to show, leave it alone for a bit and then come back.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Dec 2016 16:10:27 GMT</pubDate>
    <dc:creator>richnsanders_70</dc:creator>
    <dc:date>2016-12-28T16:10:27Z</dc:date>
    <item>
      <title>Pulling extracts from Snort alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209426#M12061</link>
      <description>&lt;P&gt;I'm trying to be less dependent on automated regex and learn more about doing my own regex for field extractions.  I have have these fields from Snort (IP addresses have been modified):&lt;/P&gt;

&lt;P&gt;12/27-13:46:30.535369  [**] [1:2019876:2] ET SCAN SSH BruteForce Tool with fake PUTTY version [**] [Classification: Detection of a Network Scan] [Priority: 3] {TCP} 100.31.116.39:35016 -&amp;gt; 172.20.16.2:22&lt;/P&gt;

&lt;P&gt;12/27-13:34:12.027500  [**] [1:2500056:4184] ET COMPROMISED Known Compromised or Hostile Host Traffic TCP group 30 [**] [Classification: Misc Attack] [Priority: 2] {TCP} 100.83.149.133:58061 -&amp;gt; 172.20.16.2:22&lt;/P&gt;

&lt;P&gt;I'm trying to extract between the first &lt;CODE&gt;[**]&lt;/CODE&gt; and the second &lt;CODE&gt;[**]&lt;/CODE&gt; giving me:&lt;/P&gt;

&lt;P&gt;ET SCAN SSH BruteForce Tool with fake PUTTY version &lt;BR /&gt;
AND &lt;BR /&gt;
ET COMPROMISED Known Compromised or Hostile Host Traffic TCP group 29&lt;/P&gt;

&lt;P&gt;The extract I put together is:&lt;BR /&gt;
&lt;CODE&gt;^\d{2}\/\d{2}-\d{2}:\d{2}:\d{2}\.\d{6}\s\s\[\*\*\]\s\[\d{1,3}:\d{2,7}:\d{1,4}\]\s(?P\D{15,75}\s)\[\*\*\]&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
It works on everything that doesn't end in a number such as TCP group 30, approximately 10% of my alerts end in a number such as 30.  I've tried everything I can think of.  Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 13:57:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209426#M12061</guid>
      <dc:creator>richnsanders_70</dc:creator>
      <dc:date>2016-12-28T13:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling extracts from Snort alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209427#M12062</link>
      <description>&lt;P&gt;Solved myself &lt;CODE&gt;^\d{2}\/\d{2}-\d{2}:\d{2}:\d{2}\.\d{6}\s\s\[\*\*\]\s\[\d{1,3}:\d{2,7}:\d{1,4}\]\s(?P&amp;lt;alert&amp;gt;((\D|\d){15,75})\s)\[\*\*\]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Just goes to show, leave it alone for a bit and then come back.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 16:10:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209427#M12062</guid>
      <dc:creator>richnsanders_70</dc:creator>
      <dc:date>2016-12-28T16:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling extracts from Snort alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209428#M12063</link>
      <description>&lt;P&gt;Please try this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query to return events
|rex " \[\*\*\].*?\](?&amp;lt;etCapturedData&amp;gt;[^\[]+)\s*\[\*\*\]"
| table etCapturedData
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can rename &lt;CODE&gt;etCapturedData&lt;/CODE&gt; field to any name of your choice by changing in &lt;CODE&gt;(?&amp;lt;etCapturedData&amp;gt;[^\[]+)&lt;/CODE&gt;&lt;BR /&gt;
&lt;A href="https://regex101.com/r/SOzTI0/1"&gt;For the Extraction and its explanation (check the right hand side columns) here&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 17:44:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209428#M12063</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-12-28T17:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling extracts from Snort alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209429#M12064</link>
      <description>&lt;P&gt;The Rex does work, but I was looking for Field Extractions, I'm assuming this is probably a more elegant way of extracting than I used.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2016 18:11:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209429#M12064</guid>
      <dc:creator>richnsanders_70</dc:creator>
      <dc:date>2016-12-28T18:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling extracts from Snort alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209430#M12065</link>
      <description>&lt;P&gt;Same regex would have worked well in the field extraction too. But if you have solved it, then good, else this regex above is much more compact and will not be too dependent on the strict sequences of &lt;CODE&gt;\d{n}&lt;/CODE&gt; as your regex might fail if:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt; The &lt;CODE&gt;\d's&lt;/CODE&gt; were to mismatch in any log line.&lt;/LI&gt;
&lt;LI&gt;If the content within the capturing group &lt;CODE&gt;(\D|\d){15,75})&lt;/CODE&gt; were to exceed 75 chars.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 29 Dec 2016 08:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Pulling-extracts-from-Snort-alerts/m-p/209430#M12065</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-12-29T08:22:28Z</dc:date>
    </item>
  </channel>
</rss>

