Dashboards & Visualizations

How to create trendline for aggregated values?

AndreasLasses
Explorer

Hello!

I am currently trying to create a dashboard (Splunk Enterprise Dashboard Beta) where I aggregate values from multiple repositories in a single value panel to get a total value. My issue is that I want to have a trendline of these aggregated values. Is there a way to achieve this?
My current (non-trendline) query looks like this:

 

 

index="my-index" repo= *
|chart latest(***.***.***.Summary) as "Summary" by repo
| eval total = sum(Summary)
| stats sum(Summary) as "Aggregated Summary"

 

 

 

Thanks in advance.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

It is not clear what you are attempting to achieve here as your chart is by repo but your stats has no by clause.

Having said that, for a trendline, you need a time component.

Just taking the first part of your search, try this

| timechart span=5m latest(***.***.***.Summary) as Summary by repo

Use a relevant time span of course.

You can visualise this as a single and you could use trellis to get a single (with trendline) for each repo.

If you still want a trendline for the total for all repos, you could do something like this

| bin _time span=5m
| stats latest(***.***.***.Summary) as Summary by _time repo
| timechart span=5m sum(Summary) as Total
0 Karma

AndreasLasses
Explorer

Thank you for your answer. Maybe I wasn't clear enough.

So what I want to do is I want to retrieve the values from EACH repo and add the values together into a new value. If repo1 and repo2 boh have "Summary" of 5, I want the aggregated value to show 10. This I have already achieved with the aforementioned query, but what I have not achieved is getting a trendline for this value.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

How does what I suggested not do what you want?

0 Karma

AndreasLasses
Explorer

It does give me a trendline, so the suggestion is not wrong. The issue is that these logs are created infrequently and there can sometimes be several days where no updates are happening and some days more than one update will be done on several repos. So what I get here will be the summary of the last day when an update happened, and only for those particular repos that were updated on that day.

What I would want is the summary of the latest run for each repo aggregated in a value with a trendline, regardless of the day it was updated. Now that I am writing my issue I realize that this will probably be next to impossible to achieve without somehow manipulating the data I send to Splunk.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...