<?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 Stats by custom string in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508490#M142076</link>
    <description>&lt;P&gt;I'd like to display stats based on a custom string within a log entry.&amp;nbsp; Below is sample of the log entry.&amp;nbsp; I'd like to parse the unique entries seen after &lt;STRONG&gt;"The following DAP records were selected for this connection:"&lt;/STRONG&gt; string.&amp;nbsp; If possible use the &lt;EM&gt;stats by&lt;/EM&gt; .... method so it displays a unique entry with the amount of times it's been seen.&amp;nbsp; &amp;nbsp;So in the case of the 2 entries below, the stats would have&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;TEST_AUTOMATION_VENDOR&lt;/STRONG&gt;, &lt;FONT face="arial,helvetica,sans-serif"&gt;and&lt;/FONT&gt;&amp;nbsp;&lt;STRONG&gt;TEST2_AUTOMATION_VENDOR&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;with a count next to it. I can do this for VPN users quite easily, but can't figure out how to do it for unique results of a string.&amp;nbsp; &amp;nbsp;I only know the basics of splunk search syntax so hopefully I'm explaining this clearly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%ASA-dap-6-734001: DAP: User TESTUSER, Addr 10.10.10.10, Connection AnyConnect: The following DAP records were selected for this connection: TEST_AUTOMATION_VENDOR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%ASA-dap-6-734001: DAP: User TESTUSER2, Addr 12.12.12.12, Connection AnyConnect: The following DAP records were selected for this connection: TEST2_AUTOMATION_VENDOR&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 14:20:17 GMT</pubDate>
    <dc:creator>dv2323</dc:creator>
    <dc:date>2020-07-10T14:20:17Z</dc:date>
    <item>
      <title>Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508490#M142076</link>
      <description>&lt;P&gt;I'd like to display stats based on a custom string within a log entry.&amp;nbsp; Below is sample of the log entry.&amp;nbsp; I'd like to parse the unique entries seen after &lt;STRONG&gt;"The following DAP records were selected for this connection:"&lt;/STRONG&gt; string.&amp;nbsp; If possible use the &lt;EM&gt;stats by&lt;/EM&gt; .... method so it displays a unique entry with the amount of times it's been seen.&amp;nbsp; &amp;nbsp;So in the case of the 2 entries below, the stats would have&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;TEST_AUTOMATION_VENDOR&lt;/STRONG&gt;, &lt;FONT face="arial,helvetica,sans-serif"&gt;and&lt;/FONT&gt;&amp;nbsp;&lt;STRONG&gt;TEST2_AUTOMATION_VENDOR&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;with a count next to it. I can do this for VPN users quite easily, but can't figure out how to do it for unique results of a string.&amp;nbsp; &amp;nbsp;I only know the basics of splunk search syntax so hopefully I'm explaining this clearly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%ASA-dap-6-734001: DAP: User TESTUSER, Addr 10.10.10.10, Connection AnyConnect: The following DAP records were selected for this connection: TEST_AUTOMATION_VENDOR&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;%ASA-dap-6-734001: DAP: User TESTUSER2, Addr 12.12.12.12, Connection AnyConnect: The following DAP records were selected for this connection: TEST2_AUTOMATION_VENDOR&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 14:20:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508490#M142076</guid>
      <dc:creator>dv2323</dc:creator>
      <dc:date>2020-07-10T14:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508496#M142079</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223581"&gt;@dv2323&lt;/a&gt;&amp;nbsp;You can use the rex command to extract the DAP record and then use stats, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index sourcetype=your_sourcetype 
| rex field=_raw "The following DAP records were selected for this connection: (?&amp;lt;dap_record&amp;gt;[A-Z_]+)"
| stats count by dap_record&lt;/LI-CODE&gt;&lt;P&gt;I hope this helps!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 14:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508496#M142079</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2020-07-10T14:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508498#M142081</link>
      <description>&lt;P&gt;Thank you that is very close to what I'm looking for!&amp;nbsp; It's working, however it's only giving me partial names, and single Letter results.&amp;nbsp; I'm thinking maybe the regex piece of [A-Z_]+ needs to be adjusted to include an entire dap record?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:07:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508498#M142081</guid>
      <dc:creator>dv2323</dc:creator>
      <dc:date>2020-07-10T15:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508506#M142084</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223581"&gt;@dv2323&lt;/a&gt;&amp;nbsp;Replace [A-Z_]+ with ".+" or ".*". You can also add an anchor "$" for end of line after the cap group if desired.&lt;BR /&gt;&lt;BR /&gt;(?&amp;lt;dap_record&amp;gt;.+)$&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:36:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508506#M142084</guid>
      <dc:creator>rbar16</dc:creator>
      <dc:date>2020-07-10T15:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508507#M142085</link>
      <description>&lt;P&gt;Sorry yes, you could use a variety of different regexs depending on what the rest of your data looks like - I missed the numerical digits..&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=your_index sourcetype=your_sourcetype 
| rex field=_raw "The following DAP records were selected for this connection: (?&amp;lt;dap_record&amp;gt;[a-zA-Z0-9_]+)
| stats count by dap_record&lt;/LI-CODE&gt;&lt;P&gt;Let me know how you get on! Fingers crossed!&lt;/P&gt;&lt;P&gt;Will&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:40:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508507#M142085</guid>
      <dc:creator>livehybrid</dc:creator>
      <dc:date>2020-07-10T15:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508516#M142088</link>
      <description>&lt;P&gt;This works well.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 16:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508516#M142088</guid>
      <dc:creator>dv2323</dc:creator>
      <dc:date>2020-07-10T16:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stats by custom string</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508517#M142089</link>
      <description>&lt;P&gt;This works well.&amp;nbsp; Gives me just the full DAP name, and count.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 16:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-by-custom-string/m-p/508517#M142089</guid>
      <dc:creator>dv2323</dc:creator>
      <dc:date>2020-07-10T16:13:53Z</dc:date>
    </item>
  </channel>
</rss>

