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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...