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!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...