Getting Data In

how to index a file from file system?

Hari5190
New Member

Hello,
I am new to splunk..This might be a very silly question but please help me ..I have a file in file system which i want to index.What is the api in java sdk to load the file and index it?How can i know when the indexing has completed

Thanks
Hari

Tags (1)
0 Karma

sdaniels
Splunk Employee
Splunk Employee

You could just use the CLI. Here's the example.

http://docs.splunk.com/Documentation/Splunk/5.0/Data/MonitorfilesanddirectoriesusingtheCLI#Example_1...

What are you trying to do? Once you add the file for monitoring you could then use the SDK to search the new data.

For the Java SDK follow instructions on GitHub. Generate the javadocs and look for the class com.splunk.MonitorInput. There are examples as well.

https://github.com/splunk/splunk-sdk-java/blob/master/tests/com/splunk/InputTest.java

0 Karma

Ayn
Legend

Also, if you're simply new to Splunk, first of all make sure that you know the basics: http://docs.splunk.com/Documentation/Splunk/5.0/Tutorial/WelcometotheSplunkTutorial

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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