Splunk Search

Help on a REX extract - and count

LizAndy123
Path Finder

So I have an Index

Index= xxxxxx "Stopping iteration"

I have the rex for getting the unique Id

Event Sample : Stopping iteration - 1900000000: 2000 Files accepted

so my current REX is rex "Stopping\siteration[\s\-]+(?<stop_reg_id>[^:\s]+)" and it extracts the 1900000000

I want to extract the 2000 number and then do a count for 24 hours.

Any help would be great

Labels (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

One way is with addcoltotals

| rex "..."
``` more query stuff```
| addcoltotals file_count

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

It would help to know what you've tried so far, but getting the other field is just a matter of extending the regex.

"Stopping\siteration[\s\-]+(?<stop_reg_id>[^:\s]+):\s*(?<file_count>\d+)"
---
If this reply helps you, Karma would be appreciated.
0 Karma

LizAndy123
Path Finder

Thanks

This helps extracting the number - how do I do the sum at the end ?

in 24 hours I could have 96 * 2000 file uploads

0 Karma

richgalloway
SplunkTrust
SplunkTrust

One way is with addcoltotals

| rex "..."
``` more query stuff```
| addcoltotals file_count

 

---
If this reply helps you, Karma would be appreciated.

LizAndy123
Path Finder

Hey Rich that works and I get the total at the bottom but it shows every single column also.

Example I had 98 Events and total was 157,000 but it shows every single event and the columns

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If all you want is a single integer that is the total of all file_count values then stats is the way to go.

| rex "..."
``` more query stuff ```
| stats sum(file_count) as Total_Count

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

LizAndy123
Path Finder

So basically I need the total number of files I uploaded in a 24 hour period once I get that figure extracted

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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...