Splunk.如何为pathparam写regex?如何为pathparam编写regex?

问题描述 投票:0回答:1

我有以下两个API

/rest/customer/{id}
/rest/customer/{id}/account

我如何写一个spunk查询来获取第一个Endpoint的记录?

splunk splunk-query
1个回答
1
投票

我不太清楚你在问什么。

这将从字符串中提取id,不管账户是否存在。

rex field=path "/rest/customer/(?<id>[^/]+)"

如果你想要的事件不是以账户结尾的,你可以尝试使用以下方法

where NOT path LIKE "%/account"
© www.soinside.com 2019 - 2024. All rights reserved.