Getting Data In

How do I make a Splunk query that reads all error code , it's message and count?

gauravepi
Path Finder

I have a JSON response now, and, from that, i want to create a table that will have all Unique Error Codes, Messages and Count . I am not able to read the JSON message in Splunk. How can we do this in Splunk? Below is one sample JSON response which i have

level:   DEBUG  
line:    43 
logger:  ErrorUtils 
message: Error: {"ErrorCode":"201","Message":"Invalid User"}    

I have created a query just to read the eventtype. i am not sure how i can proceed further on this.

eventtype="myevent"
Tags (2)
0 Karma

pramit46
Contributor

Assuming your json is properly formatted, try setting KV_Mode=json in your props.conf file against that sourcetype. It should automatically extract the field values from the json events.

You can read more about it here:
https://docs.splunk.com/Documentation/Splunk/latest/admin/Propsconf

Let me know if that helps.

0 Karma

Rob2520
Communicator

Can you share your whole JSON event?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...