steampipe plugin install consul

Table: consul_node - Query Consul Nodes using SQL

Consul is a service networking solution to connect and secure services across any runtime platform and public or private cloud. It provides a full-featured control plane with service discovery, configuration, and segmentation functionality. Consul Nodes are the basic units in a Consul cluster, and this table provides information about these nodes.

Table Usage Guide

The consul_node table provides insights into Nodes within HashiCorp's Consul service networking solution. As a DevOps engineer, you can explore node-specific details through this table, including their health, associated services, and other metadata. Utilize it to uncover information about nodes, such as their status, the services they're associated with, and their overall health within the cluster.

Examples

Basic info

Explore which nodes are part of your Consul datacenter to understand their addresses and partition details. This can help manage your datacenter more effectively by allowing you to determine the areas in which changes have been made recently.

select
id,
node,
address,
datacenter,
create_index,
modify_index,
partition
from
consul_node;
select
id,
node,
address,
datacenter,
create_index,
modify_index,
partition
from
consul_node;

List nodes from a specific datacenter

Analyze the settings to understand the distribution of nodes within a specific datacenter. This can help in managing and optimizing resources effectively across different datacenters.

select
id,
node,
address,
datacenter,
create_index,
modify_index,
partition
from
consul_node
where
datacenter = 'dc1';
select
id,
node,
address,
datacenter,
create_index,
modify_index,
partition
from
consul_node
where
datacenter = 'dc1';

List nodes with a specific tag

Explore which nodes are associated with a specific deployment tag. This can be useful in managing and organizing your resources based on their deployment status.

select
id,
node,
address datacenter,
create_index,
modify_index,
partition
from
consul_node
where
meta ->> 'deployment' = '2';
select
id,
node,
address,
datacenter,
create_index,
modify_index,
partition
from
consul_node
where
json_extract(meta, '$.deployment') = '2';

Schema for consul_node

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addresstext=The node address.
create_indexbigintAn unsigned 64-bit integer representing the index at which the node was created.
datacentertextA string specifying the datacenter in which the node is located.
idtextA string representing the unique identifier of the node.
metajsonbA map containing additional metadata associated with the node.
modify_indexbigintAn unsigned 64-bit integer representing the index at which the node was last modified.
nodetext=A string representing the name of the node.
partitiontextThe partition of the node.
peer_nametextThe node peer name.
tagged_addressesjsonbA map containing links to related tagged addresses associated with the node.
titletextThe title of the node.

Export

This table is available as a standalone Exporter 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)" -- consul

You can pass the configuration to the command with the --config argument:

steampipe_export_consul --config '<your_config>' consul_node