<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to call a macro from an intention with adv. XML in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70731#M3810</link>
    <description>&lt;P&gt;I am trying to enhance the *nix app by creating an entirely collapsed list of the available graphs for a host on a single page.  Then, a user can just click on the links that they want to load, decreasing the page load time and reducing clutter all at once.  I am sure that I will make some of the content static later, but this is just a starting point.&lt;/P&gt;

&lt;P&gt;To get the list of hosts, I have a daily search that looks for all of the hosts (| metadata type=hosts index=os | sort host | fields + host).  I then parse the results via Perl &amp;amp; API and prints a .csv in my lookup dir.  The final printout has columns with hosts and the names of macros to call from the *nix app, which draw pretty graphs.  Each host has a complete list of the macro names, which lets me lookup the table from a SearchSelectLister and present the results in a table (also built with future customizations in mind - think dynamic lists per host or host type).&lt;/P&gt;

&lt;P&gt;Everything works up to this point, and I am ready for a victory lap.  However, my dreams are shattered by this error message - "PARSER: Applying intentions failed Error in 'SearchParser': The name '$click.value2$' is invalid. Macro and argument names may only include alphanumerics, '_' and '-'.".&lt;/P&gt;

&lt;P&gt;I thought that this was the proper way to tackle this problem.  Do I have to add another field in the .csv that contains the search string (defined by the macro) and have that variable be $click.value2$?  I started down this path, but padding all of the special characters in my Perl script is taking me a bit to get straight.  It would be even better if there was a way to properly use the $click.value2$ variable when calling the macro.&lt;/P&gt;

&lt;P&gt;Any input would be greatly appreciated, I have attached my code and a screen shot for clarity.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Jim&lt;/P&gt;

&lt;P&gt;&lt;A href="https://lh6.googleusercontent.com/_Zgb9nnpHAxA/TZKih8XwwWI/AAAAAAAAAZU/---jOAXmo7I/s1440/Screen%20shot%202011-03-29%20at%2011.19.23%20PM.jpg" rel="nofollow"&gt;https://lh6.googleusercontent.com/_Zgb9nnpHAxA/TZKih8XwwWI/AAAAAAAAAZU/---jOAXmo7I/s1440/Screen%20shot%202011-03-29%20at%2011.19.23%20PM.jpg&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;view template="dashboard.html"&amp;gt;
  &amp;lt;label&amp;gt;Custom wiring the clicks&amp;lt;/label&amp;gt;
  &amp;lt;module name="AccountBar" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="AppBar" layoutPanel="navigationHeader"/&amp;gt;
  &amp;lt;module name="Message" layoutPanel="messaging"&amp;gt;
    &amp;lt;param name="filter"&amp;gt;*&amp;lt;/param&amp;gt;
    &amp;lt;param name="clearOnJobDispatch"&amp;gt;False&amp;lt;/param&amp;gt;
    &amp;lt;param name="maxSize"&amp;gt;1&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
  &amp;lt;module name="TitleBar" layoutPanel="viewHeader"&amp;gt;
    &amp;lt;param name="actionsMenuFilter"&amp;gt;dashboard&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;

  &amp;lt;module name="SearchSelectLister" layoutPanel="panel_row1_col1_grp1"&amp;gt;
    &amp;lt;param name="label"&amp;gt;Select host&amp;lt;/param&amp;gt;
    &amp;lt;param name="settingToCreate"&amp;gt;host_setting&amp;lt;/param&amp;gt;
    &amp;lt;param name="search"&amp;gt;| metadata type=hosts index=os | sort host&amp;lt;/param&amp;gt;
    &amp;lt;param name="searchWhenChanged"&amp;gt;True&amp;lt;/param&amp;gt;
    &amp;lt;param name="selected"&amp;gt;mrtg-2.unix.X.edu&amp;lt;/param&amp;gt;
    &amp;lt;param name="searchFieldsToDisplay"&amp;gt;
      &amp;lt;list&amp;gt;
        &amp;lt;param name="label"&amp;gt;host&amp;lt;/param&amp;gt;
        &amp;lt;param name="value"&amp;gt;host&amp;lt;/param&amp;gt;
      &amp;lt;/list&amp;gt;
    &amp;lt;/param&amp;gt;
    &amp;lt;module name="ConvertToIntention"&amp;gt;
      &amp;lt;param name="settingToConvert"&amp;gt;host_setting&amp;lt;/param&amp;gt;
      &amp;lt;param name="intention"&amp;gt;
        &amp;lt;param name="name"&amp;gt;addterm&amp;lt;/param&amp;gt;
        &amp;lt;param name="arg"&amp;gt;
          &amp;lt;param name="host"&amp;gt;$target$&amp;lt;/param&amp;gt;
        &amp;lt;/param&amp;gt;
        &amp;lt;!-- tells the addterm intention to put our term in the first search clause no matter what. --&amp;gt;
        &amp;lt;param name="flags"&amp;gt;&amp;lt;list&amp;gt;indexed&amp;lt;/list&amp;gt;&amp;lt;/param&amp;gt;
      &amp;lt;/param&amp;gt;

      &amp;lt;module name="GenericHeader"&amp;gt;
        &amp;lt;param name="label"&amp;gt;Reports&amp;lt;/param&amp;gt;
      &amp;lt;/module&amp;gt;
      &amp;lt;module name="HiddenSearch"&amp;gt;
        &amp;lt;param name="search"&amp;gt;| lookup all_hosts host OUTPUT report | head 1 | fields + host report | fields - _time&amp;lt;/param&amp;gt;
        &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

        &amp;lt;module name="HiddenChartFormatter"&amp;gt;
          &amp;lt;param name="chart"&amp;gt;line&amp;lt;/param&amp;gt;
          &amp;lt;param name="primaryAxisTitle.text"&amp;gt;Interface&amp;lt;/param&amp;gt;
          &amp;lt;param name="secondaryAxisTitle.text"&amp;gt;bits/sec&amp;lt;/param&amp;gt;
          &amp;lt;param name="legend.placement"&amp;gt;none&amp;lt;/param&amp;gt;
          &amp;lt;module name="JobProgressIndicator"/&amp;gt;

          &amp;lt;!-- here's the SimpleResultsTable that we'll click on --&amp;gt;
          &amp;lt;module name="SimpleResultsTable" layoutPanel="panel_row1_col1_grp1"&amp;gt;
            &amp;lt;param name="displayRowNumbers"&amp;gt;false&amp;lt;/param&amp;gt;
            &amp;lt;param name="drilldown"&amp;gt;all&amp;lt;/param&amp;gt;
            &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;

            &amp;lt;!-- We throw in a header so we can tell the user what they clicked on. --&amp;gt;
            &amp;lt;module name="SimpleResultsHeader" layoutPanel="panel_row1_col1_grp2"&amp;gt;
              &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;
              &amp;lt;param name="headerFormat"&amp;gt;CHART for time = $time$, cv=$click.value$, cv2=$click.value2$, cn=$click.name$, cn2=$click.name2$&amp;lt;/param&amp;gt;
            &amp;lt;/module&amp;gt;

            &amp;lt;!-- we swap out the search to be a timechart.  --&amp;gt;
            &amp;lt;module name="HiddenSearch"&amp;gt;
              &amp;lt;param name="search"&amp;gt;`$click.value2$($host$)`&amp;lt;/param&amp;gt;
              &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

              &amp;lt;!-- this module will grab the value we clicked on and put it in as a searchterm,   element_name="some_element_name".   --&amp;gt;
              &amp;lt;module name="ConvertToIntention"&amp;gt;
                &amp;lt;param name="intention"&amp;gt;
                  &amp;lt;param name="name"&amp;gt;addterm&amp;lt;/param&amp;gt;
                  &amp;lt;param name="arg"&amp;gt;
                    &amp;lt;param name="element_name"&amp;gt;$click.value2$&amp;lt;/param&amp;gt;
                  &amp;lt;/param&amp;gt;

                  &amp;lt;!-- tells the addterm intention to put our term in the first search clause no matter what. --&amp;gt;
                  &amp;lt;param name="flags"&amp;gt;&amp;lt;list&amp;gt;indexed&amp;lt;/list&amp;gt;&amp;lt;/param&amp;gt;
                &amp;lt;/param&amp;gt;

                &amp;lt;!-- finally, we render the search in another FlashChart, and we throw in a JobProgressIndicator for good measure. --&amp;gt;
                &amp;lt;module name="JobProgressIndicator" layoutPanel="panel_row1_col1_grp2"&amp;gt;&amp;lt;/module&amp;gt;
                &amp;lt;module name="HiddenChartFormatter" layoutPanel="panel_row1_col1_grp2"&amp;gt;
                  &amp;lt;param name="chart"&amp;gt;line&amp;lt;/param&amp;gt;
                  &amp;lt;param name="primaryAxisTitle.text"&amp;gt;Time&amp;lt;/param&amp;gt;
                  &amp;lt;param name="secondaryAxisTitle.text"&amp;gt;bits per second&amp;lt;/param&amp;gt;
                  &amp;lt;param name="legend.placement"&amp;gt;none&amp;lt;/param&amp;gt;
                  &amp;lt;module name="FlashChart"&amp;gt;
                    &amp;lt;param name="width"&amp;gt;100%&amp;lt;/param&amp;gt;
                    &amp;lt;param name="height"&amp;gt;160px&amp;lt;/param&amp;gt;
                  &amp;lt;/module&amp;gt;
                &amp;lt;/module&amp;gt;
              &amp;lt;/module&amp;gt;
            &amp;lt;/module&amp;gt;
          &amp;lt;/module&amp;gt;
        &amp;lt;/module&amp;gt;
      &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
  &amp;lt;/module&amp;gt;



&amp;lt;/view&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;New code:&lt;/P&gt;

&lt;P&gt;
  Custom wiring the clicks
  
  
  
    *
    False
    1
  
  
    dashboard
  &lt;/P&gt;

&lt;P&gt;
    Select host
    host_setting
    | metadata type=hosts index=os | sort host
    True
    mrtg-2.unix.X.edu
    
      
        host
        host
      
    
    
      host_setting
      
        addterm
        
          $target$
        
        
        indexed
      &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;module name="GenericHeader"&amp;gt;
    &amp;lt;param name="label"&amp;gt;Reports&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
  &amp;lt;module name="HiddenSearch"&amp;gt;
    &amp;lt;param name="search"&amp;gt;| lookup all_hosts host OUTPUT report | head 1 | fields + host report | fields - _time&amp;lt;/param&amp;gt;
    &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

    &amp;lt;!-- here's the SimpleResultsTable that we'll click on --&amp;gt;
    &amp;lt;module name="SimpleResultsTable" layoutPanel="panel_row1_col1_grp1"&amp;gt;
      &amp;lt;param name="displayRowNumbers"&amp;gt;false&amp;lt;/param&amp;gt;
      &amp;lt;param name="drilldown"&amp;gt;all&amp;lt;/param&amp;gt;
      &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;

      &amp;lt;!-- We throw in a header so we can tell the user what they clicked on. --&amp;gt;
      &amp;lt;module name="SimpleResultsHeader" layoutPanel="panel_row1_col1_grp2"&amp;gt;
        &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;
        &amp;lt;param name="headerFormat"&amp;gt;CHART for time = $time$, cv=$click.value$, cv2=$click.value2$, cn=$click.name$, cn2=$click.name2$&amp;lt;/param&amp;gt;
      &amp;lt;/module&amp;gt;

        &amp;lt;!-- this module will grab the value we clicked on and put it in as a searchterm, element_name="some_element_name".   --&amp;gt;
        &amp;lt;module name="ConvertToIntention"&amp;gt;
          &amp;lt;param name="intention"&amp;gt;
            &amp;lt;param name="settingToConvert"&amp;gt;click.value2&amp;lt;/param&amp;gt;
            &amp;lt;param name="name"&amp;gt;stringreplace&amp;lt;/param&amp;gt;
            &amp;lt;param name="arg"&amp;gt;
              &amp;lt;param name="element_name"&amp;gt;
                &amp;lt;param name="value"&amp;gt;$click.value2$&amp;lt;/param&amp;gt;
              &amp;lt;/param&amp;gt;
            &amp;lt;/param&amp;gt;
          &amp;lt;/param&amp;gt;

        &amp;lt;!-- this module will grab the value we clicked on and put it in as a searchterm, element_name="some_element_name".   --&amp;gt;
        &amp;lt;module name="ConvertToIntention"&amp;gt;
          &amp;lt;param name="intention"&amp;gt;
            &amp;lt;param name="settingToConvert"&amp;gt;click.value&amp;lt;/param&amp;gt;
            &amp;lt;param name="name"&amp;gt;stringreplace&amp;lt;/param&amp;gt;
            &amp;lt;param name="arg"&amp;gt;
              &amp;lt;param name="host"&amp;gt;
                &amp;lt;param name="value"&amp;gt;$click.value$&amp;lt;/param&amp;gt;
              &amp;lt;/param&amp;gt;
            &amp;lt;/param&amp;gt;
          &amp;lt;/param&amp;gt;

          &amp;lt;!-- we swap out the search to be a timechart.  --&amp;gt;
          &amp;lt;module name="HiddenSearch"&amp;gt;
            &amp;lt;param name="search"&amp;gt;`$element_name$($host$)`&amp;lt;/param&amp;gt;
            &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

            &amp;lt;!-- finally, we render the search in another FlashChart, and we throw in a JobProgressIndicator for good measure. --&amp;gt;
            &amp;lt;module name="JobProgressIndicator" layoutPanel="panel_row1_col1_grp2"&amp;gt;&amp;lt;/module&amp;gt;
            &amp;lt;module name="HiddenChartFormatter" layoutPanel="panel_row1_col1_grp2"&amp;gt;
              &amp;lt;param name="chart"&amp;gt;line&amp;lt;/param&amp;gt;
              &amp;lt;param name="primaryAxisTitle.text"&amp;gt;Time&amp;lt;/param&amp;gt;
              &amp;lt;param name="secondaryAxisTitle.text"&amp;gt;bits per second&amp;lt;/param&amp;gt;
              &amp;lt;param name="legend.placement"&amp;gt;none&amp;lt;/param&amp;gt;
              &amp;lt;module name="FlashChart"&amp;gt;
                &amp;lt;param name="width"&amp;gt;100%&amp;lt;/param&amp;gt;
                &amp;lt;param name="height"&amp;gt;160px&amp;lt;/param&amp;gt;
              &amp;lt;/module&amp;gt;
            &amp;lt;/module&amp;gt;
          &amp;lt;/module&amp;gt;
        &amp;lt;/module&amp;gt;
      &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
  &amp;lt;/module&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;
&lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2011 10:44:36 GMT</pubDate>
    <dc:creator>jamesdon</dc:creator>
    <dc:date>2011-03-30T10:44:36Z</dc:date>
    <item>
      <title>How to call a macro from an intention with adv. XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70731#M3810</link>
      <description>&lt;P&gt;I am trying to enhance the *nix app by creating an entirely collapsed list of the available graphs for a host on a single page.  Then, a user can just click on the links that they want to load, decreasing the page load time and reducing clutter all at once.  I am sure that I will make some of the content static later, but this is just a starting point.&lt;/P&gt;

&lt;P&gt;To get the list of hosts, I have a daily search that looks for all of the hosts (| metadata type=hosts index=os | sort host | fields + host).  I then parse the results via Perl &amp;amp; API and prints a .csv in my lookup dir.  The final printout has columns with hosts and the names of macros to call from the *nix app, which draw pretty graphs.  Each host has a complete list of the macro names, which lets me lookup the table from a SearchSelectLister and present the results in a table (also built with future customizations in mind - think dynamic lists per host or host type).&lt;/P&gt;

&lt;P&gt;Everything works up to this point, and I am ready for a victory lap.  However, my dreams are shattered by this error message - "PARSER: Applying intentions failed Error in 'SearchParser': The name '$click.value2$' is invalid. Macro and argument names may only include alphanumerics, '_' and '-'.".&lt;/P&gt;

&lt;P&gt;I thought that this was the proper way to tackle this problem.  Do I have to add another field in the .csv that contains the search string (defined by the macro) and have that variable be $click.value2$?  I started down this path, but padding all of the special characters in my Perl script is taking me a bit to get straight.  It would be even better if there was a way to properly use the $click.value2$ variable when calling the macro.&lt;/P&gt;

&lt;P&gt;Any input would be greatly appreciated, I have attached my code and a screen shot for clarity.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Jim&lt;/P&gt;

&lt;P&gt;&lt;A href="https://lh6.googleusercontent.com/_Zgb9nnpHAxA/TZKih8XwwWI/AAAAAAAAAZU/---jOAXmo7I/s1440/Screen%20shot%202011-03-29%20at%2011.19.23%20PM.jpg" rel="nofollow"&gt;https://lh6.googleusercontent.com/_Zgb9nnpHAxA/TZKih8XwwWI/AAAAAAAAAZU/---jOAXmo7I/s1440/Screen%20shot%202011-03-29%20at%2011.19.23%20PM.jpg&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;view template="dashboard.html"&amp;gt;
  &amp;lt;label&amp;gt;Custom wiring the clicks&amp;lt;/label&amp;gt;
  &amp;lt;module name="AccountBar" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="AppBar" layoutPanel="navigationHeader"/&amp;gt;
  &amp;lt;module name="Message" layoutPanel="messaging"&amp;gt;
    &amp;lt;param name="filter"&amp;gt;*&amp;lt;/param&amp;gt;
    &amp;lt;param name="clearOnJobDispatch"&amp;gt;False&amp;lt;/param&amp;gt;
    &amp;lt;param name="maxSize"&amp;gt;1&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
  &amp;lt;module name="TitleBar" layoutPanel="viewHeader"&amp;gt;
    &amp;lt;param name="actionsMenuFilter"&amp;gt;dashboard&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;

  &amp;lt;module name="SearchSelectLister" layoutPanel="panel_row1_col1_grp1"&amp;gt;
    &amp;lt;param name="label"&amp;gt;Select host&amp;lt;/param&amp;gt;
    &amp;lt;param name="settingToCreate"&amp;gt;host_setting&amp;lt;/param&amp;gt;
    &amp;lt;param name="search"&amp;gt;| metadata type=hosts index=os | sort host&amp;lt;/param&amp;gt;
    &amp;lt;param name="searchWhenChanged"&amp;gt;True&amp;lt;/param&amp;gt;
    &amp;lt;param name="selected"&amp;gt;mrtg-2.unix.X.edu&amp;lt;/param&amp;gt;
    &amp;lt;param name="searchFieldsToDisplay"&amp;gt;
      &amp;lt;list&amp;gt;
        &amp;lt;param name="label"&amp;gt;host&amp;lt;/param&amp;gt;
        &amp;lt;param name="value"&amp;gt;host&amp;lt;/param&amp;gt;
      &amp;lt;/list&amp;gt;
    &amp;lt;/param&amp;gt;
    &amp;lt;module name="ConvertToIntention"&amp;gt;
      &amp;lt;param name="settingToConvert"&amp;gt;host_setting&amp;lt;/param&amp;gt;
      &amp;lt;param name="intention"&amp;gt;
        &amp;lt;param name="name"&amp;gt;addterm&amp;lt;/param&amp;gt;
        &amp;lt;param name="arg"&amp;gt;
          &amp;lt;param name="host"&amp;gt;$target$&amp;lt;/param&amp;gt;
        &amp;lt;/param&amp;gt;
        &amp;lt;!-- tells the addterm intention to put our term in the first search clause no matter what. --&amp;gt;
        &amp;lt;param name="flags"&amp;gt;&amp;lt;list&amp;gt;indexed&amp;lt;/list&amp;gt;&amp;lt;/param&amp;gt;
      &amp;lt;/param&amp;gt;

      &amp;lt;module name="GenericHeader"&amp;gt;
        &amp;lt;param name="label"&amp;gt;Reports&amp;lt;/param&amp;gt;
      &amp;lt;/module&amp;gt;
      &amp;lt;module name="HiddenSearch"&amp;gt;
        &amp;lt;param name="search"&amp;gt;| lookup all_hosts host OUTPUT report | head 1 | fields + host report | fields - _time&amp;lt;/param&amp;gt;
        &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

        &amp;lt;module name="HiddenChartFormatter"&amp;gt;
          &amp;lt;param name="chart"&amp;gt;line&amp;lt;/param&amp;gt;
          &amp;lt;param name="primaryAxisTitle.text"&amp;gt;Interface&amp;lt;/param&amp;gt;
          &amp;lt;param name="secondaryAxisTitle.text"&amp;gt;bits/sec&amp;lt;/param&amp;gt;
          &amp;lt;param name="legend.placement"&amp;gt;none&amp;lt;/param&amp;gt;
          &amp;lt;module name="JobProgressIndicator"/&amp;gt;

          &amp;lt;!-- here's the SimpleResultsTable that we'll click on --&amp;gt;
          &amp;lt;module name="SimpleResultsTable" layoutPanel="panel_row1_col1_grp1"&amp;gt;
            &amp;lt;param name="displayRowNumbers"&amp;gt;false&amp;lt;/param&amp;gt;
            &amp;lt;param name="drilldown"&amp;gt;all&amp;lt;/param&amp;gt;
            &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;

            &amp;lt;!-- We throw in a header so we can tell the user what they clicked on. --&amp;gt;
            &amp;lt;module name="SimpleResultsHeader" layoutPanel="panel_row1_col1_grp2"&amp;gt;
              &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;
              &amp;lt;param name="headerFormat"&amp;gt;CHART for time = $time$, cv=$click.value$, cv2=$click.value2$, cn=$click.name$, cn2=$click.name2$&amp;lt;/param&amp;gt;
            &amp;lt;/module&amp;gt;

            &amp;lt;!-- we swap out the search to be a timechart.  --&amp;gt;
            &amp;lt;module name="HiddenSearch"&amp;gt;
              &amp;lt;param name="search"&amp;gt;`$click.value2$($host$)`&amp;lt;/param&amp;gt;
              &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

              &amp;lt;!-- this module will grab the value we clicked on and put it in as a searchterm,   element_name="some_element_name".   --&amp;gt;
              &amp;lt;module name="ConvertToIntention"&amp;gt;
                &amp;lt;param name="intention"&amp;gt;
                  &amp;lt;param name="name"&amp;gt;addterm&amp;lt;/param&amp;gt;
                  &amp;lt;param name="arg"&amp;gt;
                    &amp;lt;param name="element_name"&amp;gt;$click.value2$&amp;lt;/param&amp;gt;
                  &amp;lt;/param&amp;gt;

                  &amp;lt;!-- tells the addterm intention to put our term in the first search clause no matter what. --&amp;gt;
                  &amp;lt;param name="flags"&amp;gt;&amp;lt;list&amp;gt;indexed&amp;lt;/list&amp;gt;&amp;lt;/param&amp;gt;
                &amp;lt;/param&amp;gt;

                &amp;lt;!-- finally, we render the search in another FlashChart, and we throw in a JobProgressIndicator for good measure. --&amp;gt;
                &amp;lt;module name="JobProgressIndicator" layoutPanel="panel_row1_col1_grp2"&amp;gt;&amp;lt;/module&amp;gt;
                &amp;lt;module name="HiddenChartFormatter" layoutPanel="panel_row1_col1_grp2"&amp;gt;
                  &amp;lt;param name="chart"&amp;gt;line&amp;lt;/param&amp;gt;
                  &amp;lt;param name="primaryAxisTitle.text"&amp;gt;Time&amp;lt;/param&amp;gt;
                  &amp;lt;param name="secondaryAxisTitle.text"&amp;gt;bits per second&amp;lt;/param&amp;gt;
                  &amp;lt;param name="legend.placement"&amp;gt;none&amp;lt;/param&amp;gt;
                  &amp;lt;module name="FlashChart"&amp;gt;
                    &amp;lt;param name="width"&amp;gt;100%&amp;lt;/param&amp;gt;
                    &amp;lt;param name="height"&amp;gt;160px&amp;lt;/param&amp;gt;
                  &amp;lt;/module&amp;gt;
                &amp;lt;/module&amp;gt;
              &amp;lt;/module&amp;gt;
            &amp;lt;/module&amp;gt;
          &amp;lt;/module&amp;gt;
        &amp;lt;/module&amp;gt;
      &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
  &amp;lt;/module&amp;gt;



&amp;lt;/view&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;New code:&lt;/P&gt;

&lt;P&gt;
  Custom wiring the clicks
  
  
  
    *
    False
    1
  
  
    dashboard
  &lt;/P&gt;

&lt;P&gt;
    Select host
    host_setting
    | metadata type=hosts index=os | sort host
    True
    mrtg-2.unix.X.edu
    
      
        host
        host
      
    
    
      host_setting
      
        addterm
        
          $target$
        
        
        indexed
      &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;module name="GenericHeader"&amp;gt;
    &amp;lt;param name="label"&amp;gt;Reports&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
  &amp;lt;module name="HiddenSearch"&amp;gt;
    &amp;lt;param name="search"&amp;gt;| lookup all_hosts host OUTPUT report | head 1 | fields + host report | fields - _time&amp;lt;/param&amp;gt;
    &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

    &amp;lt;!-- here's the SimpleResultsTable that we'll click on --&amp;gt;
    &amp;lt;module name="SimpleResultsTable" layoutPanel="panel_row1_col1_grp1"&amp;gt;
      &amp;lt;param name="displayRowNumbers"&amp;gt;false&amp;lt;/param&amp;gt;
      &amp;lt;param name="drilldown"&amp;gt;all&amp;lt;/param&amp;gt;
      &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;

      &amp;lt;!-- We throw in a header so we can tell the user what they clicked on. --&amp;gt;
      &amp;lt;module name="SimpleResultsHeader" layoutPanel="panel_row1_col1_grp2"&amp;gt;
        &amp;lt;param name="entityName"&amp;gt;results&amp;lt;/param&amp;gt;
        &amp;lt;param name="headerFormat"&amp;gt;CHART for time = $time$, cv=$click.value$, cv2=$click.value2$, cn=$click.name$, cn2=$click.name2$&amp;lt;/param&amp;gt;
      &amp;lt;/module&amp;gt;

        &amp;lt;!-- this module will grab the value we clicked on and put it in as a searchterm, element_name="some_element_name".   --&amp;gt;
        &amp;lt;module name="ConvertToIntention"&amp;gt;
          &amp;lt;param name="intention"&amp;gt;
            &amp;lt;param name="settingToConvert"&amp;gt;click.value2&amp;lt;/param&amp;gt;
            &amp;lt;param name="name"&amp;gt;stringreplace&amp;lt;/param&amp;gt;
            &amp;lt;param name="arg"&amp;gt;
              &amp;lt;param name="element_name"&amp;gt;
                &amp;lt;param name="value"&amp;gt;$click.value2$&amp;lt;/param&amp;gt;
              &amp;lt;/param&amp;gt;
            &amp;lt;/param&amp;gt;
          &amp;lt;/param&amp;gt;

        &amp;lt;!-- this module will grab the value we clicked on and put it in as a searchterm, element_name="some_element_name".   --&amp;gt;
        &amp;lt;module name="ConvertToIntention"&amp;gt;
          &amp;lt;param name="intention"&amp;gt;
            &amp;lt;param name="settingToConvert"&amp;gt;click.value&amp;lt;/param&amp;gt;
            &amp;lt;param name="name"&amp;gt;stringreplace&amp;lt;/param&amp;gt;
            &amp;lt;param name="arg"&amp;gt;
              &amp;lt;param name="host"&amp;gt;
                &amp;lt;param name="value"&amp;gt;$click.value$&amp;lt;/param&amp;gt;
              &amp;lt;/param&amp;gt;
            &amp;lt;/param&amp;gt;
          &amp;lt;/param&amp;gt;

          &amp;lt;!-- we swap out the search to be a timechart.  --&amp;gt;
          &amp;lt;module name="HiddenSearch"&amp;gt;
            &amp;lt;param name="search"&amp;gt;`$element_name$($host$)`&amp;lt;/param&amp;gt;
            &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;

            &amp;lt;!-- finally, we render the search in another FlashChart, and we throw in a JobProgressIndicator for good measure. --&amp;gt;
            &amp;lt;module name="JobProgressIndicator" layoutPanel="panel_row1_col1_grp2"&amp;gt;&amp;lt;/module&amp;gt;
            &amp;lt;module name="HiddenChartFormatter" layoutPanel="panel_row1_col1_grp2"&amp;gt;
              &amp;lt;param name="chart"&amp;gt;line&amp;lt;/param&amp;gt;
              &amp;lt;param name="primaryAxisTitle.text"&amp;gt;Time&amp;lt;/param&amp;gt;
              &amp;lt;param name="secondaryAxisTitle.text"&amp;gt;bits per second&amp;lt;/param&amp;gt;
              &amp;lt;param name="legend.placement"&amp;gt;none&amp;lt;/param&amp;gt;
              &amp;lt;module name="FlashChart"&amp;gt;
                &amp;lt;param name="width"&amp;gt;100%&amp;lt;/param&amp;gt;
                &amp;lt;param name="height"&amp;gt;160px&amp;lt;/param&amp;gt;
              &amp;lt;/module&amp;gt;
            &amp;lt;/module&amp;gt;
          &amp;lt;/module&amp;gt;
        &amp;lt;/module&amp;gt;
      &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
  &amp;lt;/module&amp;gt;
&amp;lt;/module&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;
&lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2011 10:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70731#M3810</guid>
      <dc:creator>jamesdon</dc:creator>
      <dc:date>2011-03-30T10:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro from an intention with adv. XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70732#M3811</link>
      <description>&lt;P&gt;There's one big thing awry here and a couple smallish things. &lt;/P&gt;

&lt;P&gt;1) there's a stringreplace intention omitted, to make that $click.value$ get substituted: &lt;/P&gt;

&lt;P&gt;in core Splunk UI you actually need a ConvertToIntention module above this guy: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;module name="HiddenSearch"&amp;gt;
  &amp;lt;param name="search"&amp;gt;`$click.value2$($host$)`&amp;lt;/param&amp;gt;
  &amp;lt;param name="earliest"&amp;gt;-1d&amp;lt;/param&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or else nothing creates the stringreplace intention to slot into $click.value2$.  Consult the UI Examples app for an example of stringreplace intention config.  It's a bit ugly. &lt;/P&gt;

&lt;P&gt;So what's happening is that the literal string $click.value$ is going up to the search parser and the code that looks at the macro name isnt having any of it. &lt;/P&gt;

&lt;P&gt;Yes this is bizarre.  You have to take the token '$click.value$' and pass it to a 'ConvertToIntention module' so that it can become a 'stringreplace intention', so that the 'stringreplace intention' can get substituted into a string that has '$click.value$' in it.  &lt;/P&gt;

&lt;P&gt;You're not crazy.  You have to jump through hoops to turn $click.value$ back into itself (Once you get tired of this you may want to check out the sideview_utils app and the new modules therein. Among other things this app offers a world without intentions, where you just put $foo$ tokens directly into anything you want).&lt;/P&gt;

&lt;P&gt;2) Same deal but with the $host$ key.   you use the $host$ key to create an 'addterm' intention further up, and it looks like this works. This addterm intention gets consumed and (snuck in front of your &lt;CODE&gt;| lookup ...&lt;/CODE&gt; search).  The problem is that further on down you have $host$ appearing in the macro search, but without a stringreplace intention this will again not get converted.  So you need to reconvert the $host$ key with another ConvertToIntention, not into an addterm intention this time but into a stringreplace intention.  &lt;/P&gt;

&lt;P&gt;3) Minor, but you have a HiddenChartFormatter above your SimpleResultsTable that appears to do nothing. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2011 14:39:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70732#M3811</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-30T14:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to call a macro from an intention with adv. XML</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70733#M3812</link>
      <description>&lt;P&gt;Awesome stuff!  I will add the code above.  I had problems getting host assigned to more than one intention, but click.value was the same thing, so I just used that.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2011 01:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-call-a-macro-from-an-intention-with-adv-XML/m-p/70733#M3812</guid>
      <dc:creator>jamesdon</dc:creator>
      <dc:date>2011-03-31T01:55:08Z</dc:date>
    </item>
  </channel>
</rss>

