Splunk Search

How to search weekly trending for the past 30 days?

marceldera
Explorer

I have this query

index = tenable sourcetype="tenable:io:vuln" state!=fixed eventtype="*"
| dedup dns_name plugin.id
| eval discovery = strptime(last_found, "%Y-%m-%dT%H:%M:%S.%3N%Z") - strptime(first_found, "%Y-%m-%dT%H:%M:%S.%3N%Z")
| eval Age = round(discovery / 86400, 2)
| eval first_found=strftime(strptime(first_found,"%Y-%m-%dT%H:%M:%S.%3N"),"%d-%B-%y")
| eval last_found=strftime(strptime(last_found,"%Y-%m-%dT%H:%M:%S.%3N"),"%d-%B-%y")
| table plugin.id dns_name first_found last_found Age check_type category severity

I am trying to create a trending chart that shows the number of plugin.id  by week for the past 30 days.

Labels (3)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

You didn't ask a question, or explain what difficulty you have.  Make sure you present these elements so others can help you.

If I must speculate, you have tried timechart and it didn't work for some reason?  What is your test code and what is your output?

If I must speculate, first_found, last_found, etc., are unrelated to number of plugin.id.  In other words, most search terms you listed are not necessary for the task at hand?  This simple search should suffice if your requirement is simply a trending chart that shows the number of plugin.id  by week for the past 30 days.

index = tenable sourcetype="tenable:io:vuln" state!=fixed eventtype="*"
| dedup dns_name plugin.id
| timechart dc(plugin.id)
0 Karma

marceldera
Explorer

I figure it out

0 Karma
Get Updates on the Splunk Community!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...