是否可以在splunk中创建一个可点击的事件查看器字段?如何为同一任务创建javascript,我希望在事件查看器字段中显示severity
到www.google.com
的可点击链接。
我该怎么做?有什么想法吗?
答案 0 :(得分:0)
对于Splunk 5.0+,请查看dynamic drilldowns for Splunk Dashboards示例。您可以使用简单的XML表单表基于结果中的数据创建动态链接。
<dashboard>
<label>Demo: drilldown</label>
<row>
<table>
<searchString>
index=foursquare checkin.primarycategory.nodename=*
| spath output=venue path=checkin.venue.name
| spath output=badges path=checkin.badges{}.name
| eval link="Yelp Search"
| stats count as checkins sparkline values(badges)
as "badges" values(link) as "links" by venue
| sort -checkins
</searchString>
<format field="sparkline" type="sparkline">
<option name="type">bar</option>
<option name="height">30</option>
<option name="barColor">green</option>
<option name="colorMap">
<option name="5:9">yellow</option>
<option name="10:">red</option>
</option>
</format>
<title>Top Venues</title>
<drilldown>
<!-- Mulitvalue field drilldown -->
<link field="badges">
/app/foursquare_vegas/vegas_badge_1?form.badge=$click.value2$
</link>
<link field="venue">
/app/foursquare_vegas/vegas_venue_1?form.venue=$row.venue$
</link>
<link field="links">
http://www.yelp.com/search?find_desc=$row.venue$&find_loc=Las+Vegas,+NV
</link>
</drilldown>
</table>
</row>
</dashboard>
如果此示例无法实现您的目标 - 您可以随时hook into the JS events using NullModule
或投入一些精力学习SideView Utils integration。
答案 1 :(得分:0)
最接近的答案是工作流操作,它不会出现在结果表本身中,而是出现在事件之前。请查看docs了解更多信息。要准确地格式化它,您需要使用sideview utils,这样可以通过在HTML控件中嵌入搜索结果来轻松实现