Query for Datasource and related cases

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query for Datasource and related cases

L1 Bithead

Hi.

I try to create report for different datasource which create Cases or issues. i  got error > Aggregation by original_tags field of type array is unsupported. when i try to use COMP with original_tags

 

Here is example what i try to do > | filter (`resolution_status` in (RESOLVED_FALSE_POSITIVE, RESOLVED_TRUE_POSITIVE))
//| filter (`resolution_status` in (RESOLVED_FALSE_POSITIVE, RESOLVED_TRUE_POSITIVE) and `original_tags` contains """DS:PANW/*/""")
| filter (`original_tags` contains """DS:""")

1 accepted solution

Accepted Solutions

L2 Linker

Hello @T.Nurmi ,

 

Greetings for the day!

 

The error message Aggregation by original_tags field of type array is unsupported occurs because the original_tags field is stored as an array (a list of values), and the XQL comp (aggregate) stage cannot directly group data by an array object. This field captures the state of tags at the time of alert/incident creation.

To resolve this and successfully use comp with original_tags, you must first flatten the array into individual rows using the arrayexpand stage.

Recommended Solution

Insert the | arrayexpand original_tags command before your comp stage. This breaks the list of tags into separate records, allowing the aggregation engine to process each tag individually.

Updated Query Example:

dataset = incidents // or alerts
| filter resolution_status in (RESOLVED_FALSE_POSITIVE, RESOLVED_TRUE_POSITIVE)
| arrayexpand original_tags
| filter original_tags contains "DS:"
| comp count() as total_incidents by original_tags

If you feel this has answered your query, please let us know by clicking like and on "mark this as a Solution".

 

Happy New Year!!

 

Thanks & Regards,
S. Subashkar Sekar

View solution in original post

1 REPLY 1

L2 Linker

Hello @T.Nurmi ,

 

Greetings for the day!

 

The error message Aggregation by original_tags field of type array is unsupported occurs because the original_tags field is stored as an array (a list of values), and the XQL comp (aggregate) stage cannot directly group data by an array object. This field captures the state of tags at the time of alert/incident creation.

To resolve this and successfully use comp with original_tags, you must first flatten the array into individual rows using the arrayexpand stage.

Recommended Solution

Insert the | arrayexpand original_tags command before your comp stage. This breaks the list of tags into separate records, allowing the aggregation engine to process each tag individually.

Updated Query Example:

dataset = incidents // or alerts
| filter resolution_status in (RESOLVED_FALSE_POSITIVE, RESOLVED_TRUE_POSITIVE)
| arrayexpand original_tags
| filter original_tags contains "DS:"
| comp count() as total_incidents by original_tags

If you feel this has answered your query, please let us know by clicking like and on "mark this as a Solution".

 

Happy New Year!!

 

Thanks & Regards,
S. Subashkar Sekar

  • 1 accepted solution
  • 219 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!