Splunk Enterprise Security

Can you help me troubleshoot a problem adding a trendline to my query?

kokanne
Communicator

I need to make a report once a month that indicates the trend between the succesful / unsuccesful log-ins on the network. I'm using the authentication data model for this. But when adding a trendline, nothing shows up in the visualization tab. There is only one line.

Can anyone tell me what's going wrong?

| tstats summariesonly=true count from datamodel=Authentication by "Authentication.action" 
| search "Authentication.action"!="unknown" 
| trendline sma5(count) AS trend

alt text

zonistj
Path Finder

Hi,

I think you need to add the _time field to your by clause and then use timechart followed by the trendline function:

| tstats summariesonly=true count from datamodel=Authentication by "Authentication.action",_time 
| search "Authentication.action"!="unknown" 
| timechart count 
| trendline sma5(count) AS trend

That worked for me.

Edit:

Actually, that didn't work. I just realized it was going off the count of the number of "count" rather than the values you were looking for...

I think this works.

| tstats summariesonly=true count from datamodel=Authentication by "Authentication.action",_time
|rename Authentication.action AS action
| search action!="unknown" 
| timechart sum(count) AS count by action
| trendline sma5(count) AS trend

I renamed the action field to something easier to use and then did a sum of the count from tstats by action. This looked right to me based on the trendline before and after adding the timechart.

0 Karma

zonistj
Path Finder

I was just playing around with it and it turns out you don't even need the timechart. You can get it done just by adding the _time field to your by clause:

| tstats summariesonly=true count from datamodel=Authentication by "Authentication.action",_time
| search Authentication.action!="unknown" 
| trendline sma5(count) AS trend
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...