<?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 Finding unique entries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Finding-unique-entries/m-p/104681#M27131</link>
    <description>&lt;P&gt;I have syslog data that looks like so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;2013-10-17T12:37:01.608054-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.3 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:02.367813-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.131 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:03.117860-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.3 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:03.867785-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.131 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:04.617843-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.3 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:05.367849-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.131 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:08.349020-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny TCP reverse path check from 192.0.2.1 to 184.28.42.175 on interface MANAGEMENT&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I want to run a one-off query against this syslog data to pull out the unique events based on the values of two fields within each event.&lt;/P&gt;

&lt;P&gt;I'm having a hard time getting the IP addresses which I want to use as the unique values to match against other events.  Assuming the field separator is a space character, the IP address fields would be fields 10 and 12 of the sample syslog output above.&lt;/P&gt;

&lt;P&gt;In shell scripting land, I can simply use awk -F" " '{print $10" "$12)' but is there a way that is just as easy where I can specify the field delimiter and the field positions in Splunk?&lt;/P&gt;

&lt;P&gt;Am I making any sense here?&lt;/P&gt;

&lt;P&gt;Essentially what I want to see from this query is that based on the syslog sample above, the following is unique:&lt;/P&gt;

&lt;P&gt;10.10.23.2 10.10.22.3&lt;BR /&gt;
10.10.23.2 10 .10.22.131&lt;BR /&gt;
192.0.2.1 184.28.42.175&lt;/P&gt;

&lt;P&gt;The rex and regex stuff is far too complex for my little brain to comprehend, so I'm trying to see if there is a way I can use familiar tools, or concepts from familiar tools to achieve the same results.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;BTW:  Using Splunk Enterprise 6.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2013 16:58:03 GMT</pubDate>
    <dc:creator>jlixfeld</dc:creator>
    <dc:date>2013-10-17T16:58:03Z</dc:date>
    <item>
      <title>Finding unique entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-unique-entries/m-p/104681#M27131</link>
      <description>&lt;P&gt;I have syslog data that looks like so:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;2013-10-17T12:37:01.608054-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.3 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:02.367813-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.131 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:03.117860-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.3 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:03.867785-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.131 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:04.617843-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.3 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:05.367849-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny SCTP reverse path check from 10.10.23.2 to 10.10.22.131 on interface SYSTEMS-MANAGEMENT&lt;BR /&gt;
2013-10-17T12:37:08.349020-04:00 fw01.77MowatAv01.YYZ %ASA-1-106021: Deny TCP reverse path check from 192.0.2.1 to 184.28.42.175 on interface MANAGEMENT&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I want to run a one-off query against this syslog data to pull out the unique events based on the values of two fields within each event.&lt;/P&gt;

&lt;P&gt;I'm having a hard time getting the IP addresses which I want to use as the unique values to match against other events.  Assuming the field separator is a space character, the IP address fields would be fields 10 and 12 of the sample syslog output above.&lt;/P&gt;

&lt;P&gt;In shell scripting land, I can simply use awk -F" " '{print $10" "$12)' but is there a way that is just as easy where I can specify the field delimiter and the field positions in Splunk?&lt;/P&gt;

&lt;P&gt;Am I making any sense here?&lt;/P&gt;

&lt;P&gt;Essentially what I want to see from this query is that based on the syslog sample above, the following is unique:&lt;/P&gt;

&lt;P&gt;10.10.23.2 10.10.22.3&lt;BR /&gt;
10.10.23.2 10 .10.22.131&lt;BR /&gt;
192.0.2.1 184.28.42.175&lt;/P&gt;

&lt;P&gt;The rex and regex stuff is far too complex for my little brain to comprehend, so I'm trying to see if there is a way I can use familiar tools, or concepts from familiar tools to achieve the same results.&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;BTW:  Using Splunk Enterprise 6.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 16:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-unique-entries/m-p/104681#M27131</guid>
      <dc:creator>jlixfeld</dc:creator>
      <dc:date>2013-10-17T16:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Finding unique entries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-unique-entries/m-p/104682#M27132</link>
      <description>&lt;P&gt;Rex is pretty simple once you get the hang of it.  Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=_raw "(?&amp;lt;arg1&amp;gt;.*?)\s(?&amp;lt;arg2&amp;gt;.*?)\s(?&amp;lt;arg3&amp;gt;.*?) Deny TCP reverse path check from (?&amp;lt;From&amp;gt;.*?) to (?&amp;lt;To&amp;gt;.*?) on interface (?&amp;lt;interface&amp;gt;.*?)" | dedup From, To | table From, To
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Someone else may have a more elegant solution.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 17:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-unique-entries/m-p/104682#M27132</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-10-17T17:57:27Z</dc:date>
    </item>
  </channel>
</rss>

