Splunk Search

Edit a lookup file through the REST API

rolyrolex
Path Finder

Hello !!

I am new to using splunk and would like to know if it is possible to edit a lookup file via Splunk REST API or lookup editor API ? 

Thank y'all

Labels (1)

PickleRick
SplunkTrust
SplunkTrust

In general, it's not possible to update parts of a file-based lookup. You can overwrite whole lookup file (either by REST API or outputlookup command). You can of course edit the file directly on the server(s) but it will also effectively work as complete replacement of old contents when splunk reloads the lookup file.

richgalloway
SplunkTrust
SplunkTrust

There is no API for updating parts of a lookup file.  You must replace the whole thing.  See the REST Reference Manual at https://docs.splunk.com/Documentation/Splunk/8.2.2/RESTREF/RESTknowledge#data.2Flookup-table-files.2...

 

---
If this reply helps you, Karma would be appreciated.

rolyrolex
Path Finder

Thank you !!

Can i use this with splunk cloud  ? or how do i put a file in the upload staging area ?

 

0 Karma

rolyrolex
Path Finder

Thank you all for your responses.

I think I should fully explain what I would like to do to find out if this is possible.

we have lookup file configurations in a Google Sheet, currently we are updating these configurations manually in the lookup files in splunk.

Now we want to automate the creation or modification directly from the google sheet.

So I would like to know if this is possible with splunk tools.

Thank you

0 Karma

PickleRick
SplunkTrust
SplunkTrust

As we wrote - your process has to rewrite contents of the lookup completely.

As a matter of fact, I have a similar situation - my users supply data in .csv file put on a network share. I read this file as a delimited source file and push the events into a small auxiliary index. Then I do a scheduled report which reads the latest occurences of the events and ends with | outputlookup in order to write the results to a lookup. This way whenever my users put a new file into a well-known location, they get an updated lookup within few minutes.

EDIT: As a word of explanation - I could have done that perfectly well using external scripts and calling appropriate REST endpoint to refresh contents of the lookup file but in this case the point was that I wanted to do it entirely with built-in splunk functionality - without any external tools.

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...