<?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 How to edit my search to get a count of FieldA per FieldB and per FieldC where the number of FieldB is greater than 3? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158372#M44611</link>
    <description>&lt;P&gt;Good afternoon and happy monday! &lt;/P&gt;

&lt;P&gt;I'm working on trying to figure out a way to do the following :&lt;BR /&gt;
Count of vulnerabilities per eventKey, per Application where the number of eventKeys is greater than 3. &lt;/P&gt;

&lt;P&gt;Basically, if a certain app has assessments performed more than 3 times and one of the vuln results is not 0, then we want to flag them as a security risk. &lt;/P&gt;

&lt;P&gt;What I have so far, which isn't working: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search appname="*" eventtype="Complete" | dedup CompltdDate | stats dc(eventKey) by appname |  eval vuln_count=+Vulnerabilities+" Outstanding Vulnerabilities - - - "+eventKey | stats values(vuln_count) AS Total_Vuln by appname APS_UAID | eval unique_vulns=mvcount(vuln_count) | sort = -unique_vuln
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Aug 2015 18:07:10 GMT</pubDate>
    <dc:creator>antifreke</dc:creator>
    <dc:date>2015-08-10T18:07:10Z</dc:date>
    <item>
      <title>How to edit my search to get a count of FieldA per FieldB and per FieldC where the number of FieldB is greater than 3?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158372#M44611</link>
      <description>&lt;P&gt;Good afternoon and happy monday! &lt;/P&gt;

&lt;P&gt;I'm working on trying to figure out a way to do the following :&lt;BR /&gt;
Count of vulnerabilities per eventKey, per Application where the number of eventKeys is greater than 3. &lt;/P&gt;

&lt;P&gt;Basically, if a certain app has assessments performed more than 3 times and one of the vuln results is not 0, then we want to flag them as a security risk. &lt;/P&gt;

&lt;P&gt;What I have so far, which isn't working: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search appname="*" eventtype="Complete" | dedup CompltdDate | stats dc(eventKey) by appname |  eval vuln_count=+Vulnerabilities+" Outstanding Vulnerabilities - - - "+eventKey | stats values(vuln_count) AS Total_Vuln by appname APS_UAID | eval unique_vulns=mvcount(vuln_count) | sort = -unique_vuln
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2015 18:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158372#M44611</guid>
      <dc:creator>antifreke</dc:creator>
      <dc:date>2015-08-10T18:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get a count of FieldA per FieldB and per FieldC where the number of FieldB is greater than 3?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158373#M44612</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search appname="*" eventtype="Complete" | dedup CompltdDate | stats count(Vulnerabilities) as Vulnerabilities by eventKey appname | eventstats dc(eventKey) as eventKeysCount by appname | where eventKeysCount&amp;gt;3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Based on your current query, it's difficult to find out what all fields are available and useful for your requirement. Please provide what all fields are available in all events and define their values for better answer.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 21:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158373#M44612</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-10T21:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to get a count of FieldA per FieldB and per FieldC where the number of FieldB is greater than 3?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158374#M44613</link>
      <description>&lt;P&gt;Here's what I have for the table, and what the data looks like &lt;/P&gt;

&lt;P&gt;APS_UAID  | accessor  | CompltdDate   | ScanResult   | Vulnerabilities   | appname    | eventKey    | dataType&lt;/P&gt;

&lt;P&gt;001             | name 1        |  2015-03-04 17:51:00  |  Failed   | 16       | application A     | 20150304Rescan     |   Pii,Pci,Whatever&lt;BR /&gt;
001             | name  1     |  2015-08-19 9:18:00  |  Failed   | 28       | application A     | 20150819Rescan|   Pii,Pci,Whatever&lt;BR /&gt;
001             | name  1     |  2014-11-22 14:30:00  |  Failed   | 71      | application A     | 20141122Baseline|   Pii,Pci,Whatever&lt;/P&gt;

&lt;P&gt;I would like to organize this like-&lt;/P&gt;

&lt;P&gt;appname    | APS_UAID    | Vulnerabilities per Assessment ID &lt;BR /&gt;
name 1        | APS_3001    | 16 - 20150304Rescan&lt;BR /&gt;&lt;BR /&gt;
__________________________ | 28 - 20150819Rescan&lt;BR /&gt;
__________________________ |  71 - 20141122Baseline&lt;/P&gt;

&lt;P&gt;| stats count by appname APS_UAID Vulnerabilities eventKey | eval vuln_count=+Vulnerabilities+" Outstanding Vulnerabilities - - - "+eventKey | stats values(vuln_count) AS "Total Vulnerabilties per Assessment ID" by appname APS_UAID | eval unique_vulns=mvcount(vuln_count) | sort by eventKey, appname&lt;/P&gt;

&lt;P&gt;That query will do that part of it, but it will show all of them. I need to only show more than 3 assessments where none of them = 0.&lt;/P&gt;

&lt;P&gt;If there are more than 3 scans completed per App and they are still vulnerabilities. This is how we plan to keep application owners accountable for patching and securing their internet facing applications.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-get-a-count-of-FieldA-per-FieldB-and/m-p/158374#M44613</guid>
      <dc:creator>antifreke</dc:creator>
      <dc:date>2020-09-29T06:58:23Z</dc:date>
    </item>
  </channel>
</rss>

