Skip to content
Snippets Groups Projects
Commit c1742763 authored by Peter's avatar Peter Committed by Daniel Nelson
Browse files

Expand on tagvalue option in postgresql_extensible (#3720)

parent 8527a1b7
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,11 @@ The example below has two queries are specified, with the following parameters: ...@@ -43,7 +43,11 @@ The example below has two queries are specified, with the following parameters:
# withdbname was true. # withdbname was true.
# Be careful that if the withdbname is set to false you don't have to define # Be careful that if the withdbname is set to false you don't have to define
# the where clause (aka with the dbname) # the where clause (aka with the dbname)
# the tagvalue field is used to define custom tags (separated by comas) #
# the tagvalue field is used to define custom tags (separated by comas).
# the query is expected to return columns which match the names of the
# defined tags. The values in these columns must be of a string-type,
# a number-type or a blob-type.
# #
# Structure : # Structure :
# [[inputs.postgresql_extensible.query]] # [[inputs.postgresql_extensible.query]]
...@@ -109,6 +113,15 @@ using postgreql extensions ([pg_stat_statements](http://www.postgresql.org/docs/ ...@@ -109,6 +113,15 @@ using postgreql extensions ([pg_stat_statements](http://www.postgresql.org/docs/
version=901 version=901
withdbname=false withdbname=false
tagvalue="db" tagvalue="db"
[[inputs.postgresql_extensible.query]]
sqlquery="""
SELECT type, (enabled || '') AS enabled, COUNT(*)
FROM application_users
GROUP BY type, enabled
"""
version=901
withdbname=false
tagvalue="type,enabled"
``` ```
# Postgresql Side # Postgresql Side
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment