Splunk Search

How to want to assign a value from the output of a search to a variable that I need to use under JavaScript?

simona2121
Path Finder

I want to assign a value which comes under XML to a variable that I need to use under JavaScript.

or to put it better, I want to assign the value of output of a search to a variable that I need to use under javascript.

0 Karma

pasokkum
Path Finder

Try this..

 search1.startSearch();
                       var output1= search1.data('results');
                       output1.on("data", function() {   
                           var output2= output1.data().rows;
                           var finaloutput=output2[0][0];
                       });
0 Karma

jkat54
SplunkTrust
SplunkTrust

Where does the xml come from? A simple xml dashboard or xml events or elsewhere?

0 Karma

simona2121
Path Finder

I am talking about the xml code created as per the dashboard. The value fetched (from the query) inside that xml code needs to be used with javascript for evaluating "if and else" condition.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...