Splunk Search

Collect values from syslog logging

admin_fred
New Member

Hello,

I am new to splunk and have the following question. Below is snippet from a syslog logging. I would like to show the value behind (fordblks): in a chart based on _time.

[10-25 06:22:01,010] [freecwmpUTCd main          728] INF (statistics) MEM:1187840  | Total allocated space (uordblks):      997960
[10-25 06:22:01,010] [freecwmpUTCd main          728] INF (statistics) MEM:1187840  | Total free space (fordblks):           189880

I have tried rex and split and mvindex commands but I don't get it to work yet. Could anyone point me in the right direction?

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@admin_fred
Below should give you the value for fordblks and then you can chart.

|rex field=_raw "fordblks\):\s+(?<MY_VALUE>\d+)"
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

admin_fred
New Member

The code below is working as expected:

my search |rex field=_raw "fordblks):\s+(?\d+)" | stats values(MY_VALUE) by  _time my_process

note: my_process is an additional field so the statistics for 'fordblks' will be spitted up for multiple processes, which is very nice addition.

I only notice the search updates (live search) can take quite long. Maybe due to my (slow) Intel Celeron processor.

0 Karma

renjith_nair
Legend

@admin_fred
Below should give you the value for fordblks and then you can chart.

|rex field=_raw "fordblks\):\s+(?<MY_VALUE>\d+)"
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

admin_fred
New Member

Thank you very much!

The code below works fine.

|rex field=_raw "fordblks):\s+(?\d+)" | table _time MY_VALUE

How can I now present information in a chart instead of table?

0 Karma

renjith_nair
Legend

@admin_fred,
If you have different values for time, then fields _time,MY_VALUE itself could be visualized in a graph.
Or stats values(MY_VALUE) by _time or chart max(MY_VALUE) by _time depends on your requirement.

---
What goes around comes around. If it helps, hit it with Karma 🙂
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!

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...

Deep insights, no barriers: Splunk Observability Cloud Free Edition

As software delivery cycles continue to accelerate, observability shouldn’t be a luxury — it should be a ...

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...