需要一个表格来显示 Splunk 中的前 5 个 URL,如下所示。这在 Splunk 中可行吗?我尝试了很多方法,但我无法将 URL 的所有状态作为一行。
API 200 204 400 401 499 500
/wodetails/ACP 895(50%) - - - - 1
需要一个表格来显示 Splunk 中的前 5 个 URL,如下所示。这在 Splunk 中可行吗?我尝试了很多方法,但我无法将 URL 的所有状态作为一行。
API 200 204 400 401 499 500
/wodetails/ACP 895(50%) - - - - 1
这是可以使用图表命令的情况:
index="main" source="access.log" sourcetype="access_combined"
| chart c(status) by uri, status
乌里 | 200 | 204 | 400 | 499 |
---|---|---|---|---|
/基本/状态 | 11 | 1 | 1 | 1 |
/搜索结果 | 3 | 0 | 0 | 0 |
要添加百分比,您可以使用eventstats
index="main" source="access.log" sourcetype="access_combined"
| eventstats count as "totalCount" by uri
| eventstats count as "codecount" by uri, status
| eval percent=round((codecount/totalCount)*100)
| eval cell=codecount." (".percent."%)"
| chart values(cell) by uri,status
乌里 | 200 | 204 | 400 | 499 |
---|---|---|---|---|
/基本/状态 | 11 (79%) | 1 (7%) | 1 (7%) | 1 (7%) |
/搜索结果 | 3 (100%) |