Histogram

Prev Next

The histogram transform displays a bar chart or pie chart of results.

Note

A query cannot contain both groupby and histogram transforms.

Note

The histogram transform works only for custom dashboards.

TAP_histogram_scap.png

Histogram syntax

mql query | histogram <field> <period>

<field>

The field determines what data is plotted.

<period>

The time period for the bar chart to cover. Valid values are day, minute, hour, and second.

Note

TQL was previously called MQL. You still use and see mql in TQL queries.

Examples

Query

Result

has:class | histogram meta_ts day

Display results for meta_ts for the previous 24 hours in a histogram.

has:class | histogram meta_ts minute

Display results for meta_ts for the past minute in a histogram.

has:class | histogram meta_ts hour

Display results for meta_ts for the past hour in a histogram.

has:class | histogram meta_ts second

Display results for meta_ts for the past second in a histogram.