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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...