From splunk logs,how can I get a count of all those methods whose Time taken is > 10ms?
Splunk logs which look some thing like this :
csmcadvice.ExecutionTimeAdvice : <> relationId = aa12 | Method Name = methodA() Time taken is = 0ms
csmcadvice.ExecutionTimeAdvice : <> relationId = ab12 | Method Name = methodA(). Time taken is = 15ms
csmcadvice.ExecutionTimeAdvice : <> relationId = ab12 | Method Name = methodB(). Time taken is = 1ms
This would be the general idea:
| rex field=_raw "Method Name = (?<methodName>\w*)\(\)"
| rex field=_raw "Time taken is = (?<duration>\d*)ms"
| where duration > 10
| stats count by methodName
Within your search, you will need to
rex
field to grab the method namerex
field to grab the duration in millisecondswhere
command to filter the results to where your new "duration" field > 10msstats
command with count by
to count the current results, binning by your new "methodName" fieldIf this is not exactly correct for your logs, it should at least get you very close.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.