<?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 Is it possible to set the sampleRatio for a search using a drop-down token with XML? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242579#M15072</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the below XML code.  What I'm trying to do is use a drop-down so the user can select a sampling ratio for the query.  Splunk complains with this error message. Is it possible to use a drop-down to set the sampling ratio?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;XML Syntax Error: invalid literal for int() with base 10: "'$compare_mso_sample$'"



&amp;lt;input type="dropdown" token="compare_mso_sample" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Select a Sampling Ratio:&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;1:100&amp;lt;/default&amp;gt;
        &amp;lt;choice value="0"&amp;gt;0 - All Events (Computationally HEAVY)&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="10"&amp;gt;1:10&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="25"&amp;gt;1:25&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="50"&amp;gt;1:50&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="75"&amp;gt;1:75&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="100"&amp;gt;1:100&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="150"&amp;gt;1:150&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="200"&amp;gt;1:200&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="300"&amp;gt;1:300&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="500"&amp;gt;1:500&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="750"&amp;gt;1:750&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="1000"&amp;gt;1:1000&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="5000"&amp;gt;1:5000&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;table&amp;gt;
      &amp;lt;title&amp;gt;BEA Codes for $time_field.earliest$&amp;lt;/title&amp;gt;

        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index="$mso_environment$" sourcetype=wls_managedserver | lookup beacodes.csv beacode as bea_code|chart values(desc) as Description sparkline(count(bea_code)) as Trend count(bea_code) as "BEA Code Count" by bea_code|sort -"BEA Code Count"|rename bea_code as "BEA CODE - Click for Detail"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time_field_mso.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time_field_mso.latest$&amp;lt;/latest&amp;gt;
           &amp;lt;sampleRatio&amp;gt;'$compare_mso_sample$'&amp;lt;/sampleRatio&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Oct 2016 15:40:46 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2016-10-11T15:40:46Z</dc:date>
    <item>
      <title>Is it possible to set the sampleRatio for a search using a drop-down token with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242579#M15072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have the below XML code.  What I'm trying to do is use a drop-down so the user can select a sampling ratio for the query.  Splunk complains with this error message. Is it possible to use a drop-down to set the sampling ratio?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;XML Syntax Error: invalid literal for int() with base 10: "'$compare_mso_sample$'"



&amp;lt;input type="dropdown" token="compare_mso_sample" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Select a Sampling Ratio:&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;1:100&amp;lt;/default&amp;gt;
        &amp;lt;choice value="0"&amp;gt;0 - All Events (Computationally HEAVY)&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="10"&amp;gt;1:10&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="25"&amp;gt;1:25&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="50"&amp;gt;1:50&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="75"&amp;gt;1:75&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="100"&amp;gt;1:100&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="150"&amp;gt;1:150&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="200"&amp;gt;1:200&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="300"&amp;gt;1:300&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="500"&amp;gt;1:500&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="750"&amp;gt;1:750&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="1000"&amp;gt;1:1000&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="5000"&amp;gt;1:5000&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;table&amp;gt;
      &amp;lt;title&amp;gt;BEA Codes for $time_field.earliest$&amp;lt;/title&amp;gt;

        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index="$mso_environment$" sourcetype=wls_managedserver | lookup beacodes.csv beacode as bea_code|chart values(desc) as Description sparkline(count(bea_code)) as Trend count(bea_code) as "BEA Code Count" by bea_code|sort -"BEA Code Count"|rename bea_code as "BEA CODE - Click for Detail"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$time_field_mso.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$time_field_mso.latest$&amp;lt;/latest&amp;gt;
           &amp;lt;sampleRatio&amp;gt;'$compare_mso_sample$'&amp;lt;/sampleRatio&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 15:40:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242579#M15072</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-10-11T15:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set the sampleRatio for a search using a drop-down token with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242580#M15073</link>
      <description>&lt;P&gt;I had similar requirement for setting number of rows displayed in single page of table visualization and couldn't make it work. The reason was that tokens are treated as string (when used in search, splunk does implicit convert to number if required, but that doesn't happen on xml tags) and this property requires an integer value.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 19:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242580#M15073</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-11T19:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set the sampleRatio for a search using a drop-down token with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242581#M15074</link>
      <description>&lt;P&gt;Hi Somesoni2,&lt;/P&gt;

&lt;P&gt;Thanks for the reply!  I'm guessing that there is no way to convert to an integer or have the original value be an integer?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:17:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242581#M15074</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-10-11T20:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set the sampleRatio for a search using a drop-down token with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242582#M15075</link>
      <description>&lt;P&gt;I was able to do it on 6.5 on my test machine (windows 10).  Have you tried removing the single quotes surrounding your token?  Not sure why those are there?&lt;/P&gt;

&lt;P&gt;Here is what I have:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;sampling test&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="t_ratio" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Ratio&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;100&amp;lt;/default&amp;gt;
      &amp;lt;choice value="0"&amp;gt;0 - All Events (Computationally HEAVY)&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="10"&amp;gt;1:10&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="25"&amp;gt;1:25&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="50"&amp;gt;1:50&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="75"&amp;gt;1:75&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="100"&amp;gt;1:100&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="150"&amp;gt;1:150&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="200"&amp;gt;1:200&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="300"&amp;gt;1:300&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="500"&amp;gt;1:500&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="750"&amp;gt;1:750&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="1000"&amp;gt;1:1000&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="5000"&amp;gt;1:5000&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=wineventlog earliest=@d | table _time, EventCode&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;$t_ratio$&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 21:39:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242582#M15075</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2016-10-11T21:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set the sampleRatio for a search using a drop-down token with XML?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242583#M15076</link>
      <description>&lt;P&gt;Interesting, must be a 6.5 thing.  I'm on 6.4.  Time to upgrade!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 21:48:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-set-the-sampleRatio-for-a-search-using-a-drop/m-p/242583#M15076</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2016-10-11T21:48:58Z</dc:date>
    </item>
  </channel>
</rss>

