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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...