HI Splunkers,
Requirement:
I have to create table for COUNT OF ERRORS based on text search in _raw data. I have created below query:
eventtype=XXX_AC_db ("Transaction (Process ID *) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.*" OR "Rest Api POST error. Database has timed out. (TT-000346)")
| rex field=Exception "System(?<m>.*):\s(?<message>.*)\s+at"
| eval message=if(like(message,"%Transaction (Process ID %) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.%"),"Transaction (Process ID XX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.",message)
| stats count by message
| append
[ stats count
| where count=0
| eval message="Transaction (Process ID XX) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."]
| append
[| search eventtype=XXX_AC_db "Rest Api POST error. Database has timed out. (TT-000346)"
| stats count by Message
| rename Message as message]
| append
[ stats count
| where count=0
| eval message="Rest Api POST error. Database has timed out. (MG-000346)"]
| append
[| search eventtype=XXX_AC_db "*Database has timed out. (TT-000346)*"
| eval Message=if(like(Message,"%Database has timed out. (TT-000346)%"),"Database has timed out. (TT-000346)",Message)
| stats count by Message
| rename Message as message] ...................
This query is taking too much time to execute. Is there any other way so that we can include different search and get the result.
Thank you in advance.
... View more