Hi,
I use the following string to display the severity of vulnerabilities with respect to count.
vulnerability_condition="" | dedup vulnerability_name,asset_name | Top vulnerability_severity | eval black=if(vulnerability_severity="critical", count, 0)| eval red=if(vulnerability_severity="high", count, 0)| eval yellow=if(vulnerability_severity="medium", count, 0) | eval blue=if(vulnerability_severity="low", count, 0) | eval green=if(vulnerability_severity="informational", count, 0) | fields - count, percent | table vulnerability_severity, black, red, yellow, blue, green | Rename vulnerability_severity As Severity, black As Critical, red As High, yellow As Medium, blue As Low, green As Informational
As a result of this search string, the bars are displayed in a Splunk dashboard panel showing the count of vulnerabilities of each severity (like critical, high medium and low). These bars are sorted in such a manner that the severity that has larger count comes first and then followed by the rest.
I want to know if there is any option available to sort them on the basis of severity like critical comes first followed by high, then medium and then low and informational at last. There is no CVSS based number available in the logs. The vulnerabilitIes in logs only tagged with their severity levels (e.g. critical, high, medium, low and informational)
I will try to keep your query intact and just put a sortingSequence
field in there to help you sort it and see if it works for you :
|eval sortingSequence=case(vulnerability_severity="critical", 1, vulnerability_severity="high", 2, vulnerability_severity="medium", 3, vulnerability_severity="low", 4, vulnerability_severity="informational", 5, 1=1, 0)
| sort sortingSequence
So your final search becomes as:
vulnerability_condition=""
| dedup vulnerability_name,asset_name
| Top vulnerability_severity
| eval black=if(vulnerability_severity="critical", count, 0)
| eval red=if(vulnerability_severity="high", count, 0)
| eval yellow=if(vulnerability_severity="medium", count, 0)
| eval blue=if(vulnerability_severity="low", count, 0)
| eval green=if(vulnerability_severity="informational", count, 0)
|eval sortingSequence=case(vulnerability_severity="critical", 1, vulnerability_severity="high", 2, vulnerability_severity="medium", 3, vulnerability_severity="low", 4, vulnerability_severity="informational", 5, 1=1, 0)
| sort sortingSequence
| fields - count, percent, sortingSequence
| table vulnerability_severity, black, red, yellow, blue, green
| Rename vulnerability_severity As Severity, black As Critical, red As High, yellow As Medium, blue As Low, green As Informational
I will try to keep your query intact and just put a sortingSequence
field in there to help you sort it and see if it works for you :
|eval sortingSequence=case(vulnerability_severity="critical", 1, vulnerability_severity="high", 2, vulnerability_severity="medium", 3, vulnerability_severity="low", 4, vulnerability_severity="informational", 5, 1=1, 0)
| sort sortingSequence
So your final search becomes as:
vulnerability_condition=""
| dedup vulnerability_name,asset_name
| Top vulnerability_severity
| eval black=if(vulnerability_severity="critical", count, 0)
| eval red=if(vulnerability_severity="high", count, 0)
| eval yellow=if(vulnerability_severity="medium", count, 0)
| eval blue=if(vulnerability_severity="low", count, 0)
| eval green=if(vulnerability_severity="informational", count, 0)
|eval sortingSequence=case(vulnerability_severity="critical", 1, vulnerability_severity="high", 2, vulnerability_severity="medium", 3, vulnerability_severity="low", 4, vulnerability_severity="informational", 5, 1=1, 0)
| sort sortingSequence
| fields - count, percent, sortingSequence
| table vulnerability_severity, black, red, yellow, blue, green
| Rename vulnerability_severity As Severity, black As Critical, red As High, yellow As Medium, blue As Low, green As Informational