Splunk Search

How to extract values of a particular field for a json event.

tsm0099
Explorer

I have an event which is in json and it has a repeating field say "message"

Example:

{

"Message":[

{

"message":"xyz987"

},

{

"message":"abc123"

},

{

"message":"abc456"

},

{

"message":"abc567"

},

]

}

 

I have to form a table with the values of message that only starts with abc(i.e abc123, abc456, abc567) and exclude the other values(i.e xyz987)

 

How may I achieve this?

 

Thanks in advance

Labels (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
| makeresults | eval _raw="{
\"Message\":[
{
\"message\":\"xyz987\"
},
{
\"message\":\"abc123\"
},
{
\"message\":\"abc456\"
},
{
\"message\":\"abc567\"
},
]
}" | spath | mvexpand "Message{}.message"
| where match('Message{}.message',"^abc.*")
---
If this reply helps you, Karma would be appreciated.

tsm0099
Explorer

How do i form a table with those values?

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...