Splunk Search

How do I pull text our of a log to create a visual?

roderickjones
Engager

Hi, 

This might be a super basic question but I have a log and I need to create a dashboard that represents a value found in each log for that day of a file uploaded and the count of the records

EXAMPLE

: 153 cases created out of 411 import case records for file: clientfile_20201023160218.cdreq.pgp

I need a graph that will pull the "153" out of this raw log each day.

Labels (4)
0 Karma

roderickjones
Engager
Oct 23 23:15:08 myhost cdrn-issuer-import: <14>160349490844366260 cdrn-issuer-import com.cdrn.issuer.imports.batch.CdrnVersion3ItemWriter[bdfef334b18c4ee7a91a5b1a9f42656f]: 37 cases created out of 20 import case records for file: VICFT_2020102319_01.txt.pgp
 
  • host = myhost
  • index = syslog
  • source = /var/log/syslog
  • sourcetype = syslog
0 Karma

alemarzu
Motivator

Hi @roderickjones, can you share an event sample?

Something like this perhaps?

 

your_base_search
| rex "\]: (?<caseCount>\d+)[\w\s]+(?<importCount>\d+)[^\:]+:\s(?<fileName>[^\s]+)"
| timechart sum(caseCount) as totalCases, sum(importCount) as totalImports span=1d

 

Sidenote, replace the `sum` function for `values` if you only have 1 file per day. 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

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

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...