Getting Data In

Why does Splunk Custom Visualization API result in a build error on a Windows Machine?

I was trying to use Custom Visualization API to build my own custom visualization using tutorial from Splunk Docs (similar available on Splunk Dev also : ).

Following is the error I received while trying to build Custom Visualization on Windows System.

> $SPLUNK_HOME/bin/splunk cmd node ./node_modules/webpack/bin/webpack.js

'$SPLUNK_HOME' is not recognized as an internal or external command,
operable program or batch file.

Following is the error from npm-debug.log

13 info lifecycle standin@1.0.0~build: Failed to exec build script
14 verbose stack Error: standin@1.0.0 build: `$SPLUNK_HOME/bin/splunk cmd node ./node_modules/webpack/bin/webpack.js`

I was not sure if it is picking my SPLUNK_HOME path set in Windows, or has it been written only to work on Linux/Mac systems.
I have set both SPLUNK_HOME and $SPLUNK_HOME as the Splunk installation path on my machine(verified the same using echo command as below).


Can anyone confirm whether Custom Visualization worked on Windows machine? If yes, what mistake do you think I might be doing while initial setup?

| makeresults | eval message= "Happy Splunking!!!"

Splunk Employee
Splunk Employee

Hi Splunkers,

Thanks for the question (and answers). You can also find information about the configuration differences for Windows and *NIX machines here:


Eve Meelan
Technical Writer
Splunk >

Thanks @emeelan [Splunk], for providing the link to configuration differences between *NIX and Windows machines. I am aware of the differences as well. However, the issue was with documented steps of building Custom Visualizations using Custom Visualization API in Splunk documentation:

As I have mentioned in my answer below, package.json needs to be changed for Windows machine as per Environment Variable naming convention. If this can be tested by Splunk Development Team and can be documented on Splunk Docs it would be great.

Further, as you have suggested the reference to should also be available in Build Custom Visualization documentation (at least as related pages) so that developers coming from separate backgrounds can refer the same as per their build machine/environment.

| makeresults | eval message= "Happy Splunking!!!"

@frobinson, @hwakonwalk,

I was able to build the visualization by changing SPLUNK_HOME Windows Environment Variable in package.json from *NIX format (i.e. $SPLUNK_HOME) to Windows (i.e. %SPLUNK_HOME%).

  "scripts": {
    "build": "%SPLUNK_HOME%/bin/splunk cmd node ./node_modules/webpack/bin/webpack.js",
    "devbuild": "%SPLUNK_HOME%/bin/splunk cmd node ./node_modules/webpack/bin/webpack.js --progress",
    "watch": "%SPLUNK_HOME%/bin/splunk cmd node ./node_modules/webpack/bin/webpack.js -d --watch --progress"

Only hiccup was that the label "Radial Meter" set for Visualization got picked up as $label, which I had to manually edit in Splunk UI from App Manager > Settings > Name.

Please see if Dev team can verify and confirm the same.

| makeresults | eval message= "Happy Splunking!!!"

Path Finder

I got it working by reinstalling Splunk into a path without spaces. Then doing the above.

The default Windows (C:\Program Files\Splunk) kept throwing errors.

That is the first step (thanks for documenting as I had missed it)...however even after that above steps will be required.

| makeresults | eval message= "Happy Splunking!!!"



I have the same issue on windows with Splunk 6.6.2. I found a way to get the result, which is:
Add the path to splunk.exe to the windows Path environment variable (in my case C:\Program FIles\splunk\bin), and then run in the cmd window (as administrator), the line mentioned as raisng the problem (in your case, run splunk cmd node ./node_modules/webpack/bin/webpack.js from the same location). It did solve the issue on my windows laptop.
Hope it helps

0 Karma

@poete, have you tried till the Rebuild Visualization step?

| makeresults | eval message= "Happy Splunking!!!"


Of course I did, and as it did not work (and I think this is the subject of this post), I tried to figure out a way to make it work. Running the Rebuild Visualization step in verbose mode helped me to find the walk around I mentioned in my previous post. Of course ths is not a perfect solution, but at least I was able to build my Viz on windows.

0 Karma

@poete, I tried the steps you had mentioned and also added the Path for exe as you mentioned. However, the build failed again.

I have posted my changes to package.json which would allow to build the visualization on Windows machine without changes to any other documented steps.

The Environment Variable in Windows would be SPLUNK_HOME and the same would be accessed in build script with %SPLUNK_HOME% instead of $SPLUNK_HOME.

| makeresults | eval message= "Happy Splunking!!!"

Splunk Employee
Splunk Employee

Hi @niketnilay,
I've looked into your question with our engineering team and you are correct that there are differences when building custom visualizations on a Windows platform. We will need to research this further to get full details and update our documentation. In the meantime, posting here is a good option and I'll keep an eye on this thread to see what advice our community provides.

Hope this helps!

Path Finder

Hi @Frobinson and @niketnilay,
Is this issue fixed? If yes, what is the work around?

0 Karma
Get Updates on the Splunk Community!

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...

What's New in Splunk Cloud Platform 9.0.2208?!

Howdy!  We are happy to share the newest updates in Splunk Cloud Platform 9.0.2208! Analysts can benefit ...

Admin Console: A Single, Unified Interface for All Your Cloud Admin Needs

WATCH NOWJoin us to learn how the admin console can save you time and give you more control over the Splunk® ...