How do I sort entries by criticality/severity when the values aren't alphabetical?

Modified on Wed, 21 Aug, 2024 at 3:16 PM

You'll need to assign each criticality/severity value a numerical value and sort entries using that new EV.


Take these criticality/severity values for example

You could assign each a numerical value based on the criticality/severity using the following inline query logic

| eval if (risk_factor == "Critical") {risk_factor = "Urgent" ;sev = 1;}
       else if (risk_factor == "High") {sev = 2;}
       else if (risk_factor == "Medium") {sev = 3;}
       else {sev = 4;}

or by creating a resource to map each

severity,sev
Urgent,1
High,2
Medium,3
and then using the lookup module to match the severity to the EV
| lookup -r severity_to_sev risk_factor severity sev

Once the numerical value is in place, simply sort by the proper EV


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article