Splunk Cloud Platform

Rex to create log level fields for info logs?

jackin
Path Finder

Hi 

I want to create log level field for info logs.It should show the status information . 

For example the field name status, the field should show the, okay count, information count, etc count.

Please find the logs below 

Status: INFORMATION: Description: Beginning GDP Fransaction Script: 01-22-2023-01-13-04-PM

Status: INFORMATION: Description: txt file already exists

Status: INFORMATION: Description: csv file already exists

Status: OK: Description: C:\GDPFransactionScript\Inputs \GDPTestFile.csv copy to USB successful

Status: OK: Description: C:\GDPTransactionScript\Inputs \GDPTestFile.txt copy to USB successful

Status: ERROR: Description: http POST failed:

Status: ERROR: Description: https POST failed:

Status: INFORMATION: Description: End of GDP Transaction Script: 01-22-2023-01-13-04-PM

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This should get you started.

<<your search>>
| rex "Status: (?<log_level>\w+)"
| stats count by log_level
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...