tsquery Syntax

A tsquery statement has a specific structure.

SELECT [metric expression]FROM collection WHERE [predicate]

Note the following properties of tsquery statements:
  • The statement select * is invalid.
  • Tokens are case insensitive. For example, Select, select, and SeLeCt are all equivalent to SELECT.
  • Multiple statements can be concatenated with semi-colons. Thus example 3 in the tsquery Language topic can be written as:
    select jvm_heap_used_mb/1024 where category=ROLE and hostname=myhost; select jvm_heap_commited_mb/1024 where category=ROLE and hostname=myhost
  • The metric expression can be replaced with an asterisk (*), as shown in example 1 of the tsquery Language topic. In that case, all metrics that are applicable for selected entities, such as DATANODE in example 1, are returned.
  • The collection can be omitted.
  • The predicate can be omitted, as shown in example 4 of the tsquery Language topic. In such cases, time series for all entities for which the metrics are appropriate are returned. For this query you would see the jvm_new_threads metric for NameNodes, DataNodes, TaskTrackers, and so on.