深入探索 Splunk 的扩展功能
1. 事件类型渲染器测试与配置
要测试事件类型渲染器,需加载相关配置,可通过重启 Splunk 或在浏览器中访问 http://[yourserver]/debug/refresh 来实现。之后可运行查询并手动应用事件类型,示例查询如下:
index="implsplunk" sourcetype="template_example"
| eval eventtype="template_example"
为实现自动渲染,可在 eventtypes.conf 中创建事件类型定义:
[template_example]
search = sourcetype=template_example
这样,任何找到 sourcetype=template_example 事件的查询都将使用该模板进行渲染。
2. 基于字段值的字段表格
模板可访问事件中的所有内容,可按需使用字段。以下示例创建了一个水平字段表格,允许用户在特殊字段中指定要显示的特定字段集。
模板文件 appserver/event_renderers/tabular.html 内容如下:
<%inherit file="//results/EventsViewer_default_renderer.html" />
&l
超级会员免费看
订阅专栏 解锁全文
19

被折叠的 条评论
为什么被折叠?



