Dashboards & Visualizations

How to show the count that are coming on one date

aditsss
Motivator

Hi Team,

I have created one query to show case the count with date my query is below:

index="abc*" sourcetype=600000304_gg_abs_ipc2 source!="/var/log/messages" "Total msg processed for trim reage file:"
| rex "Total msg processed for trim reage file:(?<records>\d+)"
| timechart span=1d values(records) AS RecordCount

Now the issue is that I am getting the counts on one single day like this:

2023-07-06                                                                       1

                                                                                                 29

                                                                                                 42

How can I create query for this.

Labels (3)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @aditsss,

do you want the average, the max or all the values in the same row?

if avg or max, you can use this function in the stats command:

index="abc*" sourcetype=600000304_gg_abs_ipc2 source!="/var/log/messages" "Total msg processed for trim reage file:"
| rex "Total msg processed for trim reage file:(?<records>\d+)"
| timechart span=1d max(records) AS RecordCount

if you want all the values in one row, add nomv at the end:

index="abc*" sourcetype=600000304_gg_abs_ipc2 source!="/var/log/messages" "Total msg processed for trim reage file:"
| rex "Total msg processed for trim reage file:(?<records>\d+)"
| timechart span=1d values(records) AS RecordCount
| nomv RecordCount

Ciao.

Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @aditsss,

do you want the average, the max or all the values in the same row?

if avg or max, you can use this function in the stats command:

index="abc*" sourcetype=600000304_gg_abs_ipc2 source!="/var/log/messages" "Total msg processed for trim reage file:"
| rex "Total msg processed for trim reage file:(?<records>\d+)"
| timechart span=1d max(records) AS RecordCount

if you want all the values in one row, add nomv at the end:

index="abc*" sourcetype=600000304_gg_abs_ipc2 source!="/var/log/messages" "Total msg processed for trim reage file:"
| rex "Total msg processed for trim reage file:(?<records>\d+)"
| timechart span=1d values(records) AS RecordCount
| nomv RecordCount

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

hi @aditsss ,

good for you, see next time!

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...