Splunk Dev

Query many fields with the same part in the name

amielke
Communicator

Hi,

i have events in one sourcetype with over 90 similar fields like field1, field2 ... field90.

I can write a query like: search index=a sourcetype=2 field1=* field2=* ..field90=* | stats min(field1), max(field1, min(field2), max(field2)

is there a way reduce the long query to something like: index=a sourcetype=2 field*=* | stats min(field*) max(field*) ?

THX

Tags (1)
0 Karma
1 Solution

HiroshiSatoh
Champion

If _raw has a field

index=a sourcetype=2 "field*=*"|stats min(field*) as min_field* max(field*) as max_field*

※You can use wild cards for stats.

View solution in original post

HiroshiSatoh
Champion

If _raw has a field

index=a sourcetype=2 "field*=*"|stats min(field*) as min_field* max(field*) as max_field*

※You can use wild cards for stats.

amielke
Communicator

index=a sourcetype=2 |stats min(field*) as min_field* max(field*) as max_field*

Works fine, Thank you 🙂

0 Karma

woodcock
Esteemed Legend

Be sure to click Accept to close the question.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...