Running Steampipe Plugin Exporters
Each Steampipe Export CLI is distributed as a separate binary, but the command line options are the same:
Configuration
Many plugins have a default configuration that will use environment variables or other "native" configuration files to set your credentials if don't provide a --config. The behavior varies by plugin but should be documented in the Steampipe hub. The AWS plugin, for example, will resolve the region and credentials using the same mechanism as the AWS CLI (AWS environment variables, default profile, etc). If you have AWS CLI default credentials set up, Steampipe will use them if you don't specify --config:
Alternatively, you can specify the configuration with the --config argument. The --config argument takes a string containing the HCL configuration options for the plugin. The options vary per plugin, and match the connection options for the corresponding plugin. You can view the available options and syntax for the plugin in the Steampipe hub.
Note that HCL is newline-sensitive and you must include the line break. You can use \n with the bash $’string’ syntax to accomplish this:
Or you can write your config to a file:
And then cat the file into the -config arg:
Filtering Results
You can use --limit to specify the number of rows to return, which will reduce both the query time and the number of outbound API requests:
The --select argument allows you to specify which columns to return. Generally, you should select only the columns that you want in order to reduce the number of API calls, improve query performance, and minimize memory usage. Specify the columns you want, separated by a comma:
The --where argument allows you to filter the rows based on key columns:
You can only specify key columns in --where because the Export CLI does the filtering server-side, via the API or service that it is calling. Refer to the table documentation in the Steampipe hub for a list of key columns (e.g. https://hub.steampipe.io/plugins/turbot/aws/tables/aws_ec2_instance#inspect).
Note that you do not have to select the column to filter by it:
The syntax for the --where argument generally follows the same structure as a SQL where clause comparison. Be aware that not all key columns support all operators (most only support = ) and you can only use the supported operators:
You can specify multiple --where arguments, and they will be and'ed together:
Formatting output
By default, the output is returned as CSV, but you can instead return as JSON:
Or JSON lines (JSONL):
Logging
You can set the logging level with the STEAMPIPE_LOG_LEVEL environment variable. By default, the log level is set to warn.
Logs are written to STDERR so by default they will be printed to the console. You can redirect them to a file instead with the standard file redirection mechanism: