Getting Data In

Extracting of SQLite

jiamin94
Engager

Hello i would like to extract SQLite data and pass to splunk using shell script.
Anyone have any idea how to write the shell script?

Tags (3)

musskopf
Builder

Have a look on a solution I found to use sqlite3 inside python lookup scripts:

http://answers.splunk.com/answers/109009/splunk6-django-app-importing-sqlite

Once you have the sqlite module installed you could write a python script to "SELECT" your data from the sqlite3 file. If you use a script input in Splunk, your script just just needs to output something like that to the screen:

2014-06-24 14:00:12 +10:00, table="table01", columnA="value from clA row1", columnB="value from clB row1"
2014-06-24 14:00:13 +10:00, table="table01", columnA="value from clA row2", columnB="value from clB row2"

Make sure you handle the exceptions on your script and output errors to stderr so it won't index those messages.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.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 ...