Splunk Search

group keys having wildcard char like usermetadata_* by other unique field like id

neha19oct97
Engager

Hi All,

I have a requirement to group keys  (key - value pair) having wildcard char like - usermetadata_*  by other unique field value.

Here is the query i am using to get all the keys as column: 

index=<index_name> sourcetype=<source_type> splunk_server_group=default |  stats dc(usermetadata_*) as * | transpose | rename column as usermetadata | table usermetadata

I want the output like this :

id                         usermetadata_keys

xyz                    usermetadata_type

                            usermetadata_eventName

                            usermetadata_date

pqr                    usermetadata_eventType

                           usermetadata_date

 

Labels (2)
0 Karma

General_Talos
Path Finder

Can you share more details.

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...