I am trying to get the event count for below api in splunk for that I am trying to write regular expression for api but its not selecting hypen not sure how to write the regular expression to extract field out of it
"GET /v1/resource-plans/store-manager-view?type=
"GET /v1/resource-plans/trend ? xyz=
"GET /v1/resource-plans/store-director-view ? location =
"POST /v1/resource-plans
I have tried below expression its selecting store-manager and store-director into one but i need count for all api different row
(?<TYPE>\/v1\/resource-plans\/\w+)
And also i want to rename the resultant events defined in field column TYPE how to do this ? Below is my Splunk query
index=msc AND app=xyz AND source=resouce NOT message="*/_status" | rex field= message "(?<TYPE>\/v1\/resource-plans\/\w+)
" | stats count by TYPE
(?<TYPE>/v1/resource-plans/[\w-]+)
or(?<TYPE>/v1/resource-plans/[^/?#]+)
– Wiktor Stribiżewresource-plans
, see(?<TYPE>/v1/resource-plans(?:/[^/?#]+)?)
– Wiktor Stribiżew