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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...