Getting Data In

Unique Errors for Last Week over All Time

Joshua
Explorer

I currently have a search set up to identify an individual error clustered to show the total count, detail and last seen timestamp output into a CSV table over all time. This search is scheduled to run/update weekly.

log_level="ERROR" | cluster field=error showcount=true countfield=count | table, _time, count, error | sort _time| outputcsv errorhistory.csv

My goal is to use this as a refrence point whereby I can run an identical search across a period of a week / day to cross reference if the individual error has ever been seen before from the all time csv i.e. a true new error.

I have attempted various lookup's however am now stuck for a way on how to work it.

Tags (2)
0 Karma

Rob
Splunk Employee
Splunk Employee

Have you tried taking a look at using either the "uniq" function with your search?

http://www.splunk.com/base/Documentation/4.1.7/SearchReference/Uniq

You could do something such as:

log_level="ERROR" | uniq | cluster field=error showcount=true countfield=count | table, _time, count, error | sort _time| outputcsv errorhistory.csv

Joshua
Explorer

I have tried used this command however it will only return unique results from the search window selected such as that week. Which i can get by adding | search(count=1) |

Rather I need the unique results (i.e. count equal to 1) for the week and have not appeared in the errorhistory.csv

Any thoughts?

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...