Hi rflouquet,
That's a search I use to check if one of my sourcetype is sending me (in an hour) more data than it should compared to the last 3 days.
index=_internal source=*license_usage.log type=Usage st="*"
| eval h=strftime(_time, "%H:00")
| stats sum(b) as bytes by h
| eval Ko = round(bytes/1024,2)
| streamstats sum(Ko) as CKo
| chart first(CKo) as CKo over h
| join h type=left [ search index=_internal source=*license_usage.log type=Usage st="*" [ | stats count | eval earliest=strftime(relative_time(now(), "-3d"), "%m/%d/%Y:00:00:00") | return earliest ] [ | stats count | eval latest=strftime(relative_time(now(), "@d"), "%m/%d/%Y:00:00:00") | return latest ] | eval d=strftime(_time, "%Y-%m-%d") | eval h=strftime(_time, "%H:00") | stats sum(b) as bytes by h | eval Ko=round(bytes/1024,2) | streamstats sum(Ko) as CKo | eventstats sum(CKo) as CKo by h, d | stats sum(CKo) as CKo_15 by h | eval CKo_15=round(CKo_15/3, 2) ]
| fillnull value=0
| rename CKo as CGo, CKo_15 as CGo_15
| eval CGo=round(CGo/1024/1024, 2)
| eval CGo_15=round(CGo_15/1024/1024, 2)
| stats sum(*) as * by h
| rename h as Hour, CGo as "GB sum", CGo_15 as "Last 3 day GB"
What you can do is add a token to define the sourcetype.
You'll need to replace the "3 days" by "30", the "hour" by "minute", and the "sourcetype" by the "host" to match your requierement but at least you have some base to work on.
I hope this can help you build your search...
3no.
... View more