All Apps and Add-ons

unable to use $foo$ variable in hiddenchartformater

sbsbb
Builder

I'm unable to use $foo$ variable in hiddenchartformater, I get an error message on saving the view, why ?

Error :

ERROR - $chartType$ is not allowed as a value for chart. Set one of the allowed values - (area, bar, column, line, pie, scatter) or leave it blank.

1 Solution

sideview
SplunkTrust
SplunkTrust

HiddenChartFormatter is a Splunk module not a Sideview module. Sideview modules have params that almost universally interpret $foo$ tokens, whereas in the Splunk modules there are only a couple params in a couple modules.

1) If you're setting chartType from an upstream form element, you dont actually need to filter it through a HiddenChartFormatter. Just change the name of your Pulldown/Radio module from <param name="name">chartType</param> to <param name="name">charting.chart.chartType</param> and delete the problematic line from HiddenChartFormatter entirely.

2) If you have a complex and unusual use case, and ssuming you're on a reasonably current Sideview Utils version, you can replace HiddenChartFormatter with ValueSetter.

<module name="ValueSetter">
  <param name="arg.charting.chart.chartType">$chartType$</param>

and ValueSetter can do more complex things like only overwrite upstream values if other keys are set, or set according to conditional statement testing other keys against values.

If for some reason you're still using the old LGPL version (1.3.5), you should upgrade to latest (3.1.1) Here are release notes so you can see what you're missing.

http://sideviewapps.com/apps/sideview-utils/release-notes/

and here's the licensing FAQ to reassure you that the current version is as free for internal use as the old LGPL version.

http://sideviewapps.com/apps/sideview-utils/licensing-faq/

View solution in original post

sideview
SplunkTrust
SplunkTrust

HiddenChartFormatter is a Splunk module not a Sideview module. Sideview modules have params that almost universally interpret $foo$ tokens, whereas in the Splunk modules there are only a couple params in a couple modules.

1) If you're setting chartType from an upstream form element, you dont actually need to filter it through a HiddenChartFormatter. Just change the name of your Pulldown/Radio module from <param name="name">chartType</param> to <param name="name">charting.chart.chartType</param> and delete the problematic line from HiddenChartFormatter entirely.

2) If you have a complex and unusual use case, and ssuming you're on a reasonably current Sideview Utils version, you can replace HiddenChartFormatter with ValueSetter.

<module name="ValueSetter">
  <param name="arg.charting.chart.chartType">$chartType$</param>

and ValueSetter can do more complex things like only overwrite upstream values if other keys are set, or set according to conditional statement testing other keys against values.

If for some reason you're still using the old LGPL version (1.3.5), you should upgrade to latest (3.1.1) Here are release notes so you can see what you're missing.

http://sideviewapps.com/apps/sideview-utils/release-notes/

and here's the licensing FAQ to reassure you that the current version is as free for internal use as the old LGPL version.

http://sideviewapps.com/apps/sideview-utils/licensing-faq/

richgalloway
SplunkTrust
SplunkTrust

It would seem you're trying to use a variable where one is not allowed. Can you share your XML?

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What is the error message?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...