How logstash extracts specific characters from a path?

I want to extract "acpro" as the service name from the path below, can anyone offer some advice?

/api/acpro/filter/dowork/ayc
/api/acpro/filter/toko
/api/acpro/filter/toko/user/passwd
/api/acpro/account/getsales/b77dd0bf-1f85-4240-bed7-cadf2a59c5e6
/api/acpro/product/getproduct

I've tried using %{PATH} and %{GREEDYDATA} , but can't get what I want.

Hello @wajika

You can try like the below

\/%{DATA:uri}\/%{DATA:servicename}\/%{GREEDYDATA:uris}

Keep Posted!! Thanks !!!

This works, thanks, my problem is solved.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.