Splunk Search

How to customize my own event display but keep the "highlight effect" ?

leo_wang
Path Finder

I recently followed this document to customize the event display for my own eventtype : http://www.splunk.com/base/Documentation/4.1.5/Developer/EventRendering

It's quite interesting and useful, but I found the "highlight effect" of search keyword would be malfunctioned in my customized display. I know I should put some special code in my template to creat this effect, but I don't know how....

Any tips or reference ?

Leo Wang

Tags (1)

wollinet
Path Finder

Have a look here:

http://answers.splunk.com/questions/4937/custom-event-renderer

I had the same problem. If you exactly know how your event looks like and you have a predefined set of fields you can try putting this aroung your fields:

SOME_VALUE_HERE

0 Karma

leo_wang
Path Finder

Thanks for your response. but it seems not working in my case. My simple event-rendering template is like this , which just use the field value to display my event data.

<%page args="job, event, request, options" />
<% mydate = event.fields.get('date','') %>
<% mycase = event.fields.get('CaseDetail','No example') %> 
<% mydetail = event.fields.get('detail','none') %>
  <span id="eventTypeForm"/>
     <table border=1>
        <tr><td> <b>Date:</b> ${mydate|h}<br/> </td> <td>  <b>Rule :</b>${myrule|h}<br/> </td> </tr>
         <tr><td colspan=2> ${mydetail} </td> </tr>
     </table>

</div>

enter code here

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Have you specified/defined the appropriate CSS class?

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Looks to me like you would need to define a highlight color for the matched terms class, such as:

.myEventRendererClass .a {
  background-color: #F5E998;
}
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...