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, partitionfrom consul_node;
select id, node, address, datacenter, create_index, modify_index, partitionfrom 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, partitionfrom consul_nodewhere datacenter = 'dc1';
select id, node, address, datacenter, create_index, modify_index, partitionfrom consul_nodewhere 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, partitionfrom consul_nodewhere meta ->> 'deployment' = '2';
select id, node, address, datacenter, create_index, modify_index, partitionfrom consul_nodewhere json_extract(meta, '$.deployment') = '2';
Schema for consul_node
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
address | text | = | The node address. |
address_url | text | The address URL. | |
create_index | bigint | An unsigned 64-bit integer representing the index at which the node was created. | |
datacenter | text | A string specifying the datacenter in which the node is located. | |
id | text | A string representing the unique identifier of the node. | |
meta | jsonb | A map containing additional metadata associated with the node. | |
modify_index | bigint | An unsigned 64-bit integer representing the index at which the node was last modified. | |
node | text | = | A string representing the name of the node. |
partition | text | The partition of the node. | |
peer_name | text | The node peer name. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tagged_addresses | jsonb | A map containing links to related tagged addresses associated with the node. | |
title | text | The 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