Dashboards & Visualizations

Can I display multiple amMaps in a single dashboard?

beaumaris
Communicator

We are trying to create a dashboard with a focus on geolocation, with multiple panels on it. I have a simple dashboard with 2 maps driven by 2 different sets of IPs, and the second one is throwing an error "If you see this message you most likley need to adjust your HTML file in this view or you are trying to view the HTML directly instead of in a Splunk view module." which is what comes in the standard ammaps html files. The dashboard XML is correct though because if I display each panel by itself it works correctly. Is it possible to display more than one ammap panel on a dashboard? The key segments of our dashboard XML are below for reference.

      <!-- PANEL 1 -->
      <module name="HiddenSavedSearch" autoRun="True" layoutPanel="resultsAreaLeft">
        <param name="savedSearch">Populate Geolocation Map of Client IPs - Last Hour</param>
        <param name="useHistory">False</param>
      <module name="ServerSideInclude" >
        <param name="src">ammap_clients.html</param>
        <module name="ViewstateAdapter">
          <module name="HiddenFieldPicker">
            <param name="strictMode">True</param>
            <module name="JobProgressIndicator">
              <module name="EnablePreview">
                <param name="enable">True</param>
                <param name="display">False</param>
              </module>
            </module>
          </module>
        </module>
      </module>
      </module>


      <!-- PANEL 2 -->
      <module name="HiddenSavedSearch" autoRun="True" layoutPanel="resultsAreaLeft">
        <param name="savedSearch">Populate Geolocation Map of Servers - Last Hour</param>
        <param name="useHistory">False</param>
      <module name="ServerSideInclude" >
        <param name="src">ammap_servers.html</param>
        <module name="ViewstateAdapter">
          <module name="HiddenFieldPicker">
            <param name="strictMode">True</param>
            <module name="JobProgressIndicator">
              <module name="EnablePreview">
                <param name="enable">True</param>
                <param name="display">False</param>
              </module>
            </module>
          </module>
        </module>
      </module>
      </module>
Tags (2)
0 Karma
1 Solution

David
Splunk Employee
Splunk Employee

You can have multiple maps on a single dashboard. I have one view with four maps showing, myself. I may have gone a bit too far, after hitting the same error you did, but I'll tell you how I differentiate them.

I have different html files in <param name="src"> as you have above. In each html file, I reference a different settings_file and data_file. I also use different variables, since these are being included into the same page. So in my map of countries with the greatest number of phone calls, I have var soBiggestCountries = new SWFObject... and then soBiggestCountries.addVariable... Additionally, where it has the soBiggestCountries.write("...") I use a unique label (in this case, flashcontentBiggestCountries).

Perhaps more useful than the explanation, the full HTML file for one of the different maps is:

    <script type="text/javascript" src="/static/app/amMap/ammap/swfobject.js"></script>
    <div id="flashcontentBiggestCountries">
            <strong>If you see this message you most likley need to adjust your HTML file in this view or you are trying to view the HTML directly instead of in a Splunk view module.</strong>
    </div>

    <script type="text/javascript">
            // <![CDATA[
            var soBiggestCountries = new SWFObject("/static/app/CCM/ammap/ammap.swf", "ammap2", "100%", "400", "8", "#FFFFFF");
            soBiggestCountries.addVariable("path", "/static/app/CCM/ammap/");
            soBiggestCountries.addVariable("settings_file", escape("/static/app/CCM/ammap/BiggestCountriesCalled_settings.xml"));                  // you can set two or more different settings files here (separated by commas)
            soBiggestCountries.addVariable("data_file", escape("/static/app/CCM/xml_out/BiggestCountriesCalled.xml"));
            soBiggestCountries.write("flashcontentBiggestCountries");
            soBiggestCountries.addParam('wmode', 'transparent');
            // ]]>
    </script>

My settings_file is the same between them (except where I want functional differences -- different maps, etc.) and the data_file is obviously different.

View solution in original post

David
Splunk Employee
Splunk Employee

You can have multiple maps on a single dashboard. I have one view with four maps showing, myself. I may have gone a bit too far, after hitting the same error you did, but I'll tell you how I differentiate them.

I have different html files in <param name="src"> as you have above. In each html file, I reference a different settings_file and data_file. I also use different variables, since these are being included into the same page. So in my map of countries with the greatest number of phone calls, I have var soBiggestCountries = new SWFObject... and then soBiggestCountries.addVariable... Additionally, where it has the soBiggestCountries.write("...") I use a unique label (in this case, flashcontentBiggestCountries).

Perhaps more useful than the explanation, the full HTML file for one of the different maps is:

    <script type="text/javascript" src="/static/app/amMap/ammap/swfobject.js"></script>
    <div id="flashcontentBiggestCountries">
            <strong>If you see this message you most likley need to adjust your HTML file in this view or you are trying to view the HTML directly instead of in a Splunk view module.</strong>
    </div>

    <script type="text/javascript">
            // <![CDATA[
            var soBiggestCountries = new SWFObject("/static/app/CCM/ammap/ammap.swf", "ammap2", "100%", "400", "8", "#FFFFFF");
            soBiggestCountries.addVariable("path", "/static/app/CCM/ammap/");
            soBiggestCountries.addVariable("settings_file", escape("/static/app/CCM/ammap/BiggestCountriesCalled_settings.xml"));                  // you can set two or more different settings files here (separated by commas)
            soBiggestCountries.addVariable("data_file", escape("/static/app/CCM/xml_out/BiggestCountriesCalled.xml"));
            soBiggestCountries.write("flashcontentBiggestCountries");
            soBiggestCountries.addParam('wmode', 'transparent');
            // ]]>
    </script>

My settings_file is the same between them (except where I want functional differences -- different maps, etc.) and the data_file is obviously different.

beaumaris
Communicator

Excellent tip, disambiguating the variable names and the id of the

in both of my html files did the trick. Thanks!!

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