Splunk Search

Different output in execution of same splunk query.

sarvesh_11
Communicator

Hello Splunkers,
I am writing a simple splunk query to append 2 lookup.
|inputlookup test1.csv
| inputlookup append=true test2.csv
| outputlookup test1.csv

When i execute this on search, it gives me the desired result. i.e it appends the test1.csv
But when i add this to my .js

require([
"jquery",
"splunkjs/mvc/searchmanager",
"splunkjs/mvc/simplexml/ready!"
], function(
$,
SearchManager
) {
var mysearch = new SearchManager({
id: "mysearch",
autostart: "false",
search: "|inputlookup test1.csv
|inputlookup append=true test2.csv
|outputlookup test1.csv
"
});
$(".button1").on("click", function (){
var ok = confirm("Are you sure?");
if (ok){
mysearch.startSearch();
alert('attempted restart!');
} //else {
// alert('user did not click ok!');
//}
});
});

On clicking the button, this overwrites the content of test1.csv, i.e it replaces the values in test1.csv

0 Karma
Get Updates on the Splunk Community!

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...