Splunk Search

Google map set default search?

gljiva
Path Finder

Hi,
how to set default search string for Google map splunk app so that when app is opened default search is run and data is charted? I looked at maps.xml but there is so much xml that i can't seem to find appropriate place to insert:

<module name="HiddenSearch" autoRun="True">  
<param name="search">some search</param>  
0 Karma
1 Solution

ziegfried
Influencer

You can use the default parameter of the SearchBar module to pre-fill the value that is in the text box.

<module name="SearchBar" layoutPanel="splSearchControls-inline">
    <param name="useAssistant">true</param>
    <param name="useTypeahead">true</param>
    <param name="useOwnSubmitButton">False</param>
    <param name="default">sourcetype=access_combined | geoip clientip</param>

It doesn't allow you to execute it automatically though. You could create a simple dashboard instead, like this:

<view template="dashboard.html" stylesheet="dashboard.css">
  <label>Simple Google Maps Dashboard</label>
  <module name="AccountBar" layoutPanel="appHeader"/>
  <module name="AppBar" layoutPanel="navigationHeader"/>
  <module name="Message" layoutPanel="messaging">
    <param name="filter">*</param>
    <param name="clearOnJobDispatch">False</param>
    <param name="maxSize">1</param>
  </module>
  <module name="TitleBar" layoutPanel="viewHeader">
    <param name="actionsMenuFilter">dashboard</param>
  </module>  
  <module name="HiddenSearch" layoutPanel="panel_row1_col1" autoRun="true">
    <param name="search">sourcetype=access_combined earliest=-4h | geoip clientip | geonormalize</param>
    <module name="GoogleMaps">
        <param name="height">500px</param>
    </module>
  </module>
</view>

View solution in original post

JohnB
Explorer

This was a great suggestion. Is there anyway to effect the level of zoom?

0 Karma

ziegfried
Influencer

Have a look at http://SPLUNKSERVER:8000/en-US/modules#Splunk.Module.GoogleMaps which parameters are supported currently. The you're probably interested in is zoomLevel. If you have suggestions for other things that should be configurable, let me know.

0 Karma

ziegfried
Influencer

You can use the default parameter of the SearchBar module to pre-fill the value that is in the text box.

<module name="SearchBar" layoutPanel="splSearchControls-inline">
    <param name="useAssistant">true</param>
    <param name="useTypeahead">true</param>
    <param name="useOwnSubmitButton">False</param>
    <param name="default">sourcetype=access_combined | geoip clientip</param>

It doesn't allow you to execute it automatically though. You could create a simple dashboard instead, like this:

<view template="dashboard.html" stylesheet="dashboard.css">
  <label>Simple Google Maps Dashboard</label>
  <module name="AccountBar" layoutPanel="appHeader"/>
  <module name="AppBar" layoutPanel="navigationHeader"/>
  <module name="Message" layoutPanel="messaging">
    <param name="filter">*</param>
    <param name="clearOnJobDispatch">False</param>
    <param name="maxSize">1</param>
  </module>
  <module name="TitleBar" layoutPanel="viewHeader">
    <param name="actionsMenuFilter">dashboard</param>
  </module>  
  <module name="HiddenSearch" layoutPanel="panel_row1_col1" autoRun="true">
    <param name="search">sourcetype=access_combined earliest=-4h | geoip clientip | geonormalize</param>
    <module name="GoogleMaps">
        <param name="height">500px</param>
    </module>
  </module>
</view>

gljiva
Path Finder

Works great, thx.

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 ...