Hello eveyrone,
Firstly Big Thanks to @ITWhisperer for helping me in recent weeks 😊
I have created a splunk query which will display the data as below.
Operations
average
response90
create_cart
250
380
cart_summary
240
330
cart_productType
210
321
getCart
260
365
index=my_index openshift_cluster="cluster009" sourcetype=openshift_logs openshift_namespace=my_ns openshift_container_name=container
| search ("POST /shopping/carts/v1 HTTP"
OR "GET /shopping/carts/v1/*/summary HTTP"
OR "GET *shopping*carts*productType* HTTP")
| eval Operations=case(
searchmatch("POST /shopping/carts/v1 HTTP"),"create_cart",
searchmatch("GET /shopping/carts/v1/*/summary HTTP"),"cart_summary",
searchmatch("GET *shopping*carts*productType* HTTP"),"cart_productType")
| stats avg(processDuration) as average perc90(processDuration) as response90 by Operations
| eval average=round(average,2),response90=round(response90,2)
I want to include 1 more search pattern as below:
"message":{"input":"999.111.000.999 - - [06/Apr/2023:04:08:13 +0000] \"GET /shopping/carts/v1/83h3h331-g494-28h4-yyw7-dq123123123d HTTP/1.1\" 200 1855 8080 10 ms"}
Hence I changed the splunk query something like below to display the above formatted tabular information
index=my_index openshift_cluster="cluster009" sourcetype=openshift_logs openshift_namespace=my_ns openshift_container_name=container
| rex "\"(?<url>GET /shopping/carts/v1/[^/ ?]+\sHTTP)"
| search ("POST /shopping/carts/v1 HTTP"
OR "GET /shopping/carts/v1/*/summary HTTP"
OR "GET *shopping*carts*productType* HTTP")
OR url
| eval Operations=case(
searchmatch("POST /shopping/carts/v1 HTTP"),"create_cart",
searchmatch("GET /shopping/carts/v1/*/summary HTTP"),"cart_summary",
searchmatch("GET *shopping*carts*productType* HTTP"),"cart_productType",
searchmatch(url),"getCart")
| stats avg(processDuration) as average perc90(processDuration) as response90 by Operations
| eval average=round(average,2),response90=round(response90,2)
I am encountering the error stating : Error in 'EvalCommand': The arguments to the 'searchmatch' function are invalid.
... View more