Splunk + Steampipe
Splunk software is used for searching, monitoring and analyzing log data.
Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.
List indexes in your Splunk account:
select name, max_time, total_event_countfrom splunk_index;
+----------------+---------------------+-------------------+| name | max_time | total_event_count |+----------------+---------------------+-------------------+| my_event_index | 2021-11-18T01:29:21 | 2345 |+----------------+---------------------+-------------------+
Documentation
Get started
Install
Download and install the latest Splunk plugin:
steampipe plugin install splunk
Configuration
Installing the latest splunk plugin will create a config file (~/.steampipe/config/splunk.spc
) with a single connection named splunk
:
connection "splunk" { plugin = "splunk"
# Splunk base URL. # Can also be set with the SPLUNK_URL environment variable. # Defaults to "https://localhost:8089". url = "https://localhost:8089"
# You can connect to Splunk using one of the options below:
# 1. Authenticate using username and password # If `username` or `password` are not specified credentials will be loaded # from the `SPLUNK_USERNAME` and `SPLUNK_PASSWORD` environment variables # respectively. # username = "admin" # password = "password"
# 2. Authenticate using Splunk authentication token # If `auth_token` is not specified, it will be loaded from the # `SPLUNK_AUTH_TOKEN` environment variable. # auth_token = "<YOUR_AUTH_TOKEN>"}
Postgres FDW
This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- splunk
The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.
To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.
CREATE EXTENSION IF NOT EXISTS steampipe_postgres_splunk;CREATE SERVER steampipe_splunk FOREIGN DATA WRAPPER steampipe_postgres_splunk OPTIONS (config '<your_config>');CREATE SCHEMA splunk;IMPORT FOREIGN SCHEMA splunk FROM SERVER steampipe_splunk INTO splunk;
SQLite Extension
This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- splunk
The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.
To configure the SQLite extension, load the extension module and then run the steampipe_configure_splunk
function to configure it with plugin-specific options.
$ sqlite3sqlite> .load ./steampipe_sqlite_extension_splunk.sosqlite> select steampipe_configure_splunk('<your_config>');
Export
This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- splunk
You can pass the configuration to the command with the --config
argument:
steampipe_export_splunk --config '<your_config>' <table_name>