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!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...