在某个点之后过滤掉部分文件路径
Filtering out parts of file path after a certain point
文件路径搜索到比预期更深的级别。我只需要 /aaa,但我的搜索正在填充 /aaa/bbbb/ccc/ddd/ 的所有值。有没有办法删除 /aaa/ 之后的所有内容?
my search: index=web_pn_iis sourcetype=iis cs_uri_stem="*" sc_status=4* | where not cs_uri_stem="/*"
returned values:/aaa/bbbb/ccc/ddd/
want: /aaa
rex
命令可以做到这一点。
index=web_pn_iis sourcetype=iis cs_uri_stem="*" sc_status=4*
| where not cs_uri_stem="/*"
| rex field=cs_uri_stem "(?<want>\/\w+)"
文件路径搜索到比预期更深的级别。我只需要 /aaa,但我的搜索正在填充 /aaa/bbbb/ccc/ddd/ 的所有值。有没有办法删除 /aaa/ 之后的所有内容?
my search: index=web_pn_iis sourcetype=iis cs_uri_stem="*" sc_status=4* | where not cs_uri_stem="/*"
returned values:/aaa/bbbb/ccc/ddd/
want: /aaa
rex
命令可以做到这一点。
index=web_pn_iis sourcetype=iis cs_uri_stem="*" sc_status=4*
| where not cs_uri_stem="/*"
| rex field=cs_uri_stem "(?<want>\/\w+)"