Dashboards & Visualizations

How to Extract the field from Splunk Logs

aditsss
Motivator

Hi Everyone,

How can I extract the Below word OutOfMemoryErrofrom the splunk losg

2021-03-24T09:01:32.357185211Z app_name=dgfassetmutation environment=e1 ns=blazepsfsubscribememsql-c2 pod_container=dgfassetmutation pod_name=dgfassetmutation-deployment-3-p24np stream=stdout message=Terminating due to java.lang.OutOfMemoryError: Metaspace

 

2021-03-03T12:45:30.036179788Z app_name=pulldataoneforce environment=e1 ns=blazepsfpublish pod_container=pulldataoneforce pod_name=pulldataoneforce-deployment-175-kv9tv stream=stdout message=Caused by: java.lang.OutOfMemoryError: unable to create new native thread

Thanks in advance

 

Labels (2)
0 Karma
1 Solution

manjunathmeti
Champion

You put message= outside group capture.

| rex "message=(?<message>[^\n]+)"

View solution in original post

manjunathmeti
Champion

hi @aditsss,
Try this, highlighted values will be part of field error.

| rex "java\.lang\.(?<error>\w+)\:\s(?<error_msg>[^\n]+)"

 

If this reply helps you, an upvote/like would be appreciated.

 

0 Karma

aditsss
Motivator

@manjunathmeti 

I want to show the complete error message (The highlighted one)

2021-03-24T09:01:32.357185211Z app_name=dgfassetmutation environment=e1 ns=blazepsfsubscribememsql-c2 pod_container=dgfassetmutation pod_name=dgfassetmutation-deployment-3-p24np stream=stdout message=Terminating due to java.lang.OutOfMemoryError: Metaspace

 

2021-03-03T12:45:30.036179788Z app_name=pulldataoneforce environment=e1 ns=blazepsfpublish pod_container=pulldataoneforce pod_name=pulldataoneforce-deployment-175-kv9tv stream=stdout message=Caused by: java.lang.OutOfMemoryError: unable to create new native thread

 How can I extract the complete message

0 Karma

manjunathmeti
Champion

Try this:

| rex "(?<message>message=[^\n]+)"
0 Karma

aditsss
Motivator

@manjunathmeti 

Its working fine but I want to remove message= part. Currently its coming like this:

message=Caused by: java.lang.NullPointerException: null

I want it to show like this:

Caused by: java.lang.NullPointerException: null

How can I achieve this

0 Karma

manjunathmeti
Champion

You put message= outside group capture.

| rex "message=(?<message>[^\n]+)"
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...