Skip to content

Commit

Permalink
RemoveEmptyTags added to query.html.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Potęga committed May 5, 2017
1 parent 6cba257 commit d6afb99
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions website/source/docs/agent/http/query.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ to static templates, except with some additional fields and features. Here's an
"Name": "geo-db",
"Template": {
"Type": "name_prefix_match",
"Regexp": "^geo-db-(.*?)-([^\\-]+?)$"
"Regexp": "^geo-db-(.*?)-([^\\-]+?)$",
"RemoveEmptyTags": false
},
"Service": {
"Service": "mysql-${match(1)}",
Expand All @@ -192,7 +193,7 @@ to static templates, except with some additional fields and features. Here's an
```

The new `Template` structure configures a prepared query as a template instead of a
static query. It has two fields:
static query. It has three fields:

`Type` is the query type, which must be "name_prefix_match". This means that the
template will apply to any query lookup with a name whose prefix matches the `Name`
Expand All @@ -207,6 +208,10 @@ takes the first item after the "-" as the database name and everything else afte
a tag. See the [RE2](https://github.com/google/re2/wiki/Syntax) reference for syntax
of this regular expression.

An optional `RemoveEmptyTags` boolean may be set to true, if the returned tags list
is to be stripped of empty string elements. `RemoveEmptyTags` defaults to false
(all tags are being returned, including empty strings).

All other fields of the query have the same meanings as for a static query, except
that several interpolation variables are available to dynamically populate the query
before it is executed. All of the string fields inside the `Service` structure are
Expand Down Expand Up @@ -470,7 +475,8 @@ a JSON body will be returned like this:
"Name": "geo-db",
"Template": {
"Type": "name_prefix_match",
"Regexp": "^geo-db-(.*?)-([^\\-]+?)$"
"Regexp": "^geo-db-(.*?)-([^\\-]+?)$",
"RemoveEmptyTags": false
},
"Service": {
"Service": "mysql-customer",
Expand Down

0 comments on commit d6afb99

Please sign in to comment.