Splunk Dev

Add data with Python

DavidHourani
Super Champion

Hello Splunkers!

I want to make a page on splunk that resembles to "add data" page on which one can drag and drop a file to add it into Splunk. Anyone knows where I can find the python code to do that ? Or maybe some code that allows me to connect to splunk and input data from a file.

Best regards,
David

0 Karma
1 Solution

GregZillgitt
Path Finder

The Splunk Python SDK contains a script called "upload.py" in the root of the "examples" directory. Should be just what you're looking for. Have a look: https://github.com/splunk/splunk-sdk-python/blob/master/examples/upload.py

View solution in original post

GregZillgitt
Path Finder

The Splunk Python SDK contains a script called "upload.py" in the root of the "examples" directory. Should be just what you're looking for. Have a look: https://github.com/splunk/splunk-sdk-python/blob/master/examples/upload.py

rsathish47
Contributor

HI David ,

You check in uploader app in the splunk base.
https://splunkbase.splunk.com/app/1707/

Thanks
Sathish rangan

DavidHourani
Super Champion

I will have a look at it. thank you for your help Sathish.. any Git you know that might be doing that also ?

0 Karma

jkat54
SplunkTrust
SplunkTrust

Sounds like you're reinventing the wheel a bit here. What's the purpose behind this exercise? Funzies or are you trying to build an external file input page? If it's the later, I recommend installing a "heavy forwarder" and giving your users access to the add data page. If it's for fun, then we got a long conversation ahead of us.

0 Karma

DavidHourani
Super Champion

so yes it's for fun lol

0 Karma

DavidHourani
Super Champion

I want to make an app that allows you to drag and drop PCAP files-> read + convert to selecter format-> splunk it... so yeah sort of reinventing the wheel for the drag and drop page but i want to make something that looks nice.

0 Karma
Get Updates on the Splunk Community!

Pro Tips for First-Time .conf Attendees: Advice from SplunkTrust

Heading to your first .Conf? You’re in for an unforgettable ride — learning, networking, swag collecting, ...

Raise Your Skills at the .conf25 Builder Bar: Your Splunk Developer Destination

Calling all Splunk developers, custom SPL builders, dashboarders, and Splunkbase app creators – the Builder ...

Hunt Smarter, Not Harder: Discover New SPL “Recipes” in Our Threat Hunting Webinar

Are you ready to take your threat hunting skills to the next level? As Splunk community members, you know the ...