Reporting

Remove Chart in PDF report in Splunk 5

asarolkar
Builder

Hi,

Using the new PDF export feature in Splunk 5, I generate a PDF report that prints multi-line results per Organization.

This works perfectly.

However there are 10,000+ organizations with TIMES 20 rows per org.

There is an ugly chart that the report displays on top (because the search I used has a stats in it).

Anybody know how to remove a chart on top from a Splunk 5 PDF report when the search that generates the report has a "stats" in its criteria ?

Tags (4)

paramagurukarth
Builder

I don't know any straight forward answer for this. but I have an work around for this..
My Suggestion is :
* Create a css file inside your apps appserver/static directory
* Edit your appserver/static/application.js as below

switch (Splunk.util.getCurrentView()) {
    case "Your_view_name":
        if(window.location.href.indexOf("output=pdf")){
            jQuery("<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/app/AppName/cusPdf.css\"/>").appendTo("head");
        }
        break;
}

The above code will load your css file into your html only when the url contains teh string "output=pdf" (It is the parameter required to generate pdfs).

Inside your css file , write your css rules to hide the map or table or graph you want.. Even you can customize your PDF contents 🙂

 eg:
.firstCell {
    display: none !important;
}

If you know the the UI module used by your graph or charts you can directly sett= inline style using javascript/jQuery ...
Refer sample application.js for more info
http://docs.splunk.com/Documentation/Splunk/6.2.2/Module/Example3-Simplecustomizations

0 Karma

o_calmels
Communicator

Hi, if still applicable on december 2014

Can you post your search request please ?
Olivier.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...