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.

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...