Splunk Search

How to display a trendline for distinct count of a field

jbrenner
Path Finder

I want to add a trendline to this chart:

index=my_index
| timechart dc(USER) as DISTINCT_USERS

How do I accomplish this?

Thanks!

Jonathan

Labels (1)
0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi

Add the trendline command after your timechart:

index=my_index
| timechart dc(USER) as DISTINCT_USERS
| trendline sma5(DISTINCT_USERS) as trend_DISTINCT_USERS

This adds a 5-point simple moving average trendline.

Adjust the window size (e.g., sma7, sma10) as needed.

Trendline documentation

🌟Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...