Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

The “name” variable is basically a “reserved keyword” that will be substituted with the alert name, internally the code is making a lookup in a dictionary:

if ‘alert_subject_args’ in self.rule:
alert_subject_args = self.rule[‘alert_subject_args’]

Looking at other parts of the code reveals that “self.rule” is a dictionary, which has an element called “name” containing the alert name defined in the rule file

Advertisements
 
  • David Vassallo 12:10 pm on November 22, 2016 Permalink
    Tags: ,   

    Embedding Javascript and HTML into Kibana 5.x 

    Reading this post:

    http://www.supermind.org/blog/1213/embed-custom-javascript-and-html-in-a-kibana-4-x-visualization

    Kelvin makes a really good suggestion…. and very good inspiration. The suggestion works fine but in my case I needed it to go a step further – I needed to embed an iframe into Kibana. The iframe (and indeed any other <script> tag) was being filtered out by Angular’s sanitization protection. I needed to disable this and make sure that Angular trusts any inputted HTML and displays it as is. TO do this, we need to change the file kibana/src/core_plugins/markdown_vis/public/markdown_vis_controller.js to:

    Notes:

    • Line 12: we inject $sce into the controller
    • Line 15, we use the $sce.trustAsHTML function to avoid HTML sanitation

    Obviously…. be very careful, this leaves you wide open to some nasty stuff like XSS, javascript attacks and so on…. make sure your kibana users are trusted

     
  • c
    Compose new post
    j
    Next post/Next comment
    k
    Previous post/Previous comment
    r
    Reply
    e
    Edit
    o
    Show/Hide comments
    t
    Go to top
    l
    Go to login
    h
    Show/Hide help
    shift + esc
    Cancel
    %d bloggers like this: