Hi everybody
Can you help me and suggest me a solution about my context.
I have many servers Jboss, and each server host many instance/JVM (1 to 4).
Example a server jboss_server1 hosts 2 instances jb_instance1 and jb_instance2.
An instance is identified by a search time field JBOSS_INSTANCE.
I would like scheduled a search to monitor the daily volume log for each instance and trigger an alert when the volume exceed a daily quota (300 MB for example)
To do this I write a search :
index="jboss" earliest=-0d@d [search index=_internal source=*license_usage.log type=Usage earliest=-0d@d | stats sum(b) as bytes by h | rename h as host | where (bytes/1024/1024)>300
| fields - bytes] NOT ([|inputlookup high_volume_jboss | fields JBOSS_INSTANCE]) | fields + host,CTX,JBOSS_INSTANCE | eval raw_len=len(_raw) | stats sum(raw_len) As TotalSize by host,CTX,JBOSS_INSTANCE | eval TotalSizeMB=round(TotalSize/1024/1024,2),
quotaMB=250,newLogLevel="ERROR"| where TotalSizeMB > 250
I make search with a join on the license_usage.log to match the host which log more than 300MB (don't forget i want sizing by instance not by host)
I make a second filter to exclude instance that is matched in a input lookup containing pair host/instance matched by a precedent search in the day
I calculate the size of each raw matched
But I think this is not optimized. What do you think ?
... View more