Dashboards & Visualizations

Modern JS Tooling Setup for Splunk App / Sourcemaps Not Working Properly

jdawsonqmulos
Observer

I'm working on a Splunk app which uses Webpack to bundle and compile the Javascript to ES5. I'm generating sourcemaps using the "source-map" devtool option in the webpack.config.

As detailed in this post by @aprummer , Splunk injects some lines of internationalization code during runtime at the top of each page, which throws off the reference points within the sourcemaps. @aprummer solved this by regenerating the sourcemaps with a line offset. I tried this approach offsetting the sourcemaps by the 5 lines added at the beginning of each file, and while I did see some success with some breakpoints being hit closer to the entry point of the JS code, they are still not matching up and variables are not resolving properly.

Has anyone else had any success with using Webpack and modern JS tooling within Splunk, and if so, how did you get source maps setup properly?

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...