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!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...