Splunk Search

How to upload file on dashboard, without navigating to another page?

Path Finder

Hi Splunkers,
I have a use case to deploy, please refer the image attached.
On clicking "choose file" it should browse from the local machine.
On clicking upload it shall store the uploaded file on lookups directory of specific app.
On Submit button we have a SPL query that will merge the lookup, also in merging the lookup, i have to use the name of the uploaded file, which has to be dynamic
alt text

0 Karma

SplunkTrust
SplunkTrust

You need to write JavaScript and python for this.

Frankly, it's not easy.

You could extend the rest api to create a file upload endpoint that does most of the logic.

The endpoint would be coded so that it accepts file of csv format and puts it in the correct app.

The JavaScript would be coded so that it uploads the file to the endpoint while staying on the same page.

The last time I wrote JS to handle a file upload I followed tutorials like this one: https://www.w3schools.com/jsref/prop_fileupload_files.asp