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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

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