steampipe plugin install consul

Table: consul_service - Query OCI Consul Services 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. Given that, Consul enables rapid deployment, configuration, and maintenance of service-oriented architectures at a massive scale.

Table Usage Guide

The consul_service table provides insights into Consul Services within Oracle Cloud Infrastructure (OCI). As a network administrator, explore service-specific details through this table, including service configurations, status, and associated metadata. Utilize it to uncover information about services, such as those with specific configurations, the relationships between services, and the verification of service status.

Examples

Basic info

Explore the various services within your network infrastructure to identify their associated data centers and namespaces. This can help you better understand the overall structure and organization of your services, which is useful in managing and optimizing your network resources.

select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service;
select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service;

List services present in default namespace

Explore which services are present in the default namespace. This can help in understanding the configuration and organization of your services, and identify any areas for optimization or restructuring.

select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
namespace = 'default';
select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
namespace = 'default';

List services which are not associated with any health checks

Uncover the details of services that are not linked with any health checks. This can be useful for identifying potential vulnerabilities in your system, as these services may not be monitored for issues or failures.

select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
checks is null;
select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
checks is null;

List services with a specific tag

Explore which services are associated with a specific tag to better manage and organize your resources. This can be particularly useful for identifying patterns or issues related to a specific service category.

select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
service_tag = 'http';
select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
service_tag = 'http';

List services running in a specific node

Explore which services are actively running within a specific node for effective management and monitoring. This is particularly useful for identifying any potential issues or inconsistencies within your network infrastructure.

select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
node = 'ip-172-25-34-191';
select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
node = 'ip-172-25-34-191';

List services where service tags can be overridden

Explore which services allow for tag overrides, useful for identifying areas where service tagging behavior can be customized to suit specific requirements. This can be beneficial in managing and organizing your services more effectively.

select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
service_enable_tag_override;
select
id,
node,
address,
datacenter,
service_id,
service_name,
namespace
from
consul_service
where
service_enable_tag_override = 1;

Schema for consul_service

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addresstextThe IP address or hostname of the service.
checksjsonbThe health checks associated with the service.
create_indexbigintThe index of the create operation that created the service.
datacentertextThe datacenter where the service is running.
idtextA unique identifier for the service.
modify_indexbigintThe index of the last modify operation that modified the service.
namespacetext=The namespace of the service.
nodetextThe name of the node where the service is running.
node_metajsonbA map of metadata associated with the node where the service is running.
partitiontextThe partition of the service.
service_addresstextThe IP address or hostname of the service instance.
service_enable_tag_overridebooleanA boolean indicating whether service tags can be overridden.
service_idtextThe unique identifier for the service instance.
service_metajsonbA map of metadata associated with the service.
service_nametext=The name of the service.
service_portbigintThe port on which the service instance is listening.
service_proxyjsonbThe proxy configuration for the service.
service_tagtextThe service tag.
service_tagged_addressesjsonbA map of service tags to service addresses.
service_weightsjsonbThe weights associated with the service.
tagged_addressesjsonbA map of service tags to IP addresses or hostnames.
titletextThe title of the service.

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_service