Thanks for your patience. Embedding the URL in a table surrounded by
tags is the secret:
dplrgid8@:/home/dplrgid8/logstash/dev/templates/$ cat example.my_body.txt
if( "grok0714" in [tags] ){
if( "Error" in [err_num] ){
if( "No space left on device" in [narrative] ){
mutate{
### Replacing msg_level with err_num because it is blank. 2/7/2017 - Brian
replace => { "msg_level" => "%{err_num}" }
add_field => [ "[@metadata][my_body]", "
<html>
<body>
<table style=width:\"100%\">
<tr>
<td><pre>%{err_num} from %{host}:%{path}</pre></td>
<tr>
<td><b>Copy & Paste Visualization Link to FireFox Browser:</b></td>
<tr>
<td>http://xx.xx.xx.com:5602/app/kibana#/visualize/create?embed=true&type=histogram&indexPattern=dplr-qa-logstash-*&_g=(refreshInterval:(display:'1%20minute',pause:!f,section:2,value:60000),time:(from:now-1h,mode:quick,to:now))&_a=(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'host:%20%22hltv0777.hydc.xx.com%22%20AND%20err_num:%20%22HP-UX%20Error:%22')),uiState:(),vis:(aggs:!((id:'1',params:(),schema:metric,type:count),(id:'2',params:(customInterval:'2h',extended_bounds:(),field:'@timestamp',interval:auto,min_doc_count:1),schema:segment,type:date_histogram),(id:'3',params:(field:host.raw,order:desc,orderBy:'1',size:5),schema:group,type:terms)),listeners:(),params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,mode:stacked,scale:linear,setYExtents:!f,shareYAxis:!t,times:!(),yAxis:()),title:'New%20Visualization',type:histogram))</td>
<tr>
<td><b>Copy & Paste Discovery Link to FireFox Browser:</b></td>
<tr>
<td>http://xx.xx.xxcom:5602/app/kibana#/discover?_g=(refreshInterval:(display:'1%20minute',pause:!f,section:2,value:60000),time:(from:now-1h,mode:quick,to:now))&_a=(columns:!(err_num,type,narrative),index:'dplr-qa-logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'err_num:%20%22HP-UX%20Error:%2028%22%20AND%20type:%20%22habitat.exception%22%20AND%20%20host:%20%22hltv0777.hydc.xx.com%22')),sort:!('@timestamp',desc))</td>
<tr>
<td><b>Narrative:</b></tb>
<tr>
<td><pre>%{narrative}</pre></td>
<tr>
<td><b>Tags:</b></tb>
<tr>
<td><pre>%{tags}</pre></td>
</table>
</pre>
</body>
</html> " ]
}
throttle {
before_count =>-1
after_count => 1
period => "3600"
key => "%{narrative}"
add_field => [ "tags", "throttled" ]
}
}
}
}
}
Results in:
HP-UX Error: 28 from hltv0777.hydc.sbc.com:/opt/app/globalid/data/server/Release-9-0/logs/135.213.40.121_45402_exception.log
Copy & Paste Visualization Link to FireFox Browser:
http://xx.xx.xxcom:5602/app/kibana#/visualize/create?embed=true&type=histogram&indexPattern=dplr-qa-logstash-*&_g=(refreshInterval:(display:'1%20minute',pause:!f,section:2,value:60000),time:(from:now-1h,mode:quick,to:now))&_a=(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'host:%20%22hltv0777.hydc.xx.com%22%20AND%20err_num:%20%22HP-UX%20Error:%22')),uiState:(),vis:(aggs:!((id:'1',params:(),schema:metric,type:count),(id:'2',params:(customInterval:'2h',extended_bounds:(),field:'@timestamp',interval:auto,min_doc_count:1),schema:segment,type:date_histogram),(id:'3',params:(field:host.raw,order:desc,orderBy:'1',size:5),schema:group,type:terms)),listeners:(),params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,mode:stacked,scale:linear,setYExtents:!f,shareYAxis:!t,times:!(),yAxis:()),title:'New%20Visualization',type:histogram))
Copy & Paste Discovery Link to FireFox Browser:
http://xx.xx.xx.com:5602/app/kibana#/discover?_g=(refreshInterval:(display:'1%20minute',pause:!f,section:2,value:60000),time:(from:now-1h,mode:quick,to:now))&_a=(columns:!(err_num,type,narrative),index:'dplr-qa-logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'err_num:%20%22HP-UX%20Error:%2028%22%20AND%20type:%20%22habitat.exception%22%20AND%20%20host:%20%22hltv0777.hydc.xx.com%22')),sort:!('@timestamp',desc))
Narrative:
No space left on device
Tags:
grok0714
|