Splunk Search

How To Hide The Search Bar

Ant1D
Motivator

Hey,

I have a question.

When I view a chart and I decide to click 'View results', it takes me to a flashtimeline page which displays the results in a table along with the actual search that produced those results.

How can I disable this search bar from being displayed in this situation? When I click 'View Results' from a chart, I do not want other users of my Splunk instance to see the search which created the chart.

Any info on this is greatly appreciated. Thanks.

1 Solution

southeringtonp
Motivator

To hide the search bar, you will need to use the Advanced XML syntax.

First, create a new view to drill into. If you want, you can clone flashtimeline and then just remove the SearchBar module and it's param entries. You'll also need to add layoutPanel="splSearchControls-inline" back onto the TimeRangePicker module, since you removed the layoutPanel assignment when you removed the SearchBar.

Then modify your existing view (the one you want to drilldown from):

  • If you are using Simple XML, view it with ?showsource=1 to convert it to Advanced XML.
  • Change the value of viewTarget from "flashtimeline" to your new view:
  • <module name="SimpleResultsTable">
        <param name="drilldown">row</param>
        <module name="ConvertToDrilldownSearch">
            <module name="ViewRedirector">
                <param name="viewTarget">flashtimeline2</param>
            </module>
        </module>
    </module>
    

    This will still leave the search string exposed in the URL, however. If you need to hide more of it, you might try saving the search and calling it from the dashboards via | savedsearch, or using search macros to hide some elements.

    View solution in original post

    kmattern
    Builder

    Edit this line in $SPLUNK_HOME$\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\controllers\module.py

    su.quoteattr("Splunk.window.openJobInspector('%s');return
    false;" % sid.replace("'",
    "")),_('Inspect ...')

    comment out inspect and add ('.') so it reads like this

    su.quoteattr("Splunk.window.openJobInspector('%s');return
    false;" % sid.replace("'",
    "")),_('.')

    this gives you what we call the magic dot. It is clickable and will take you to the flashtimeline but the user will never notice.

    Comment this line in $SPLUNK_HOME$\share\splunk\search_mrsparkle\modules\search\ViewRedirectorLink.html

    ${module.get("label",
    _("View results")) | h}

    and add this line

    ${module.get("label",
    _(".")) | h}

    You will get the same result.

    0 Karma

    southeringtonp
    Motivator

    To hide the search bar, you will need to use the Advanced XML syntax.

    First, create a new view to drill into. If you want, you can clone flashtimeline and then just remove the SearchBar module and it's param entries. You'll also need to add layoutPanel="splSearchControls-inline" back onto the TimeRangePicker module, since you removed the layoutPanel assignment when you removed the SearchBar.

    Then modify your existing view (the one you want to drilldown from):

  • If you are using Simple XML, view it with ?showsource=1 to convert it to Advanced XML.
  • Change the value of viewTarget from "flashtimeline" to your new view:
  • <module name="SimpleResultsTable">
        <param name="drilldown">row</param>
        <module name="ConvertToDrilldownSearch">
            <module name="ViewRedirector">
                <param name="viewTarget">flashtimeline2</param>
            </module>
        </module>
    </module>
    

    This will still leave the search string exposed in the URL, however. If you need to hide more of it, you might try saving the search and calling it from the dashboards via | savedsearch, or using search macros to hide some elements.

    Get Updates on the Splunk Community!

    Unlock Database Monitoring with Splunk Observability Cloud

      In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

    Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

    At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

    [Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

    Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...