Skip to content

Commit 328f987

Browse files
committed
Update doc to introduce timefield parameter
Signed-off-by: Yuanchun Shen <[email protected]>
1 parent 5c17695 commit 328f987

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/user/ppl/cmd/timechart.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ Syntax
2222

2323
.. code-block:: text
2424
25-
timechart [span=<time_interval>] [limit=<number>] [useother=<boolean>] <aggregation_function> [by <field>]
25+
timechart [timefield=<field_name>] [span=<time_interval>] [limit=<number>] [useother=<boolean>] <aggregation_function> [by <field>]
2626
2727
**Parameters:**
2828

29+
* **timefield**: optional. Specifies the timestamp field to use for time interval grouping.
30+
31+
* Default: ``@timestamp``
32+
* Specify a timestamp field for the time-based aggregation.
33+
2934
* **span**: optional. Specifies the time interval for grouping data.
3035

3136
* Default: 1m (1 minute)
@@ -105,7 +110,7 @@ Return type: DOUBLE
105110
Notes
106111
=====
107112

108-
* The ``timechart`` command requires a timestamp field named ``@timestamp`` in the data.
113+
* The ``timechart`` command requires a timestamp field in the data. By default, it uses the ``@timestamp`` field, but you can specify a different field using the ``timefield`` parameter.
109114
* Results are returned in an unpivoted format with separate rows for each time-field combination that has data.
110115
* Only combinations with actual data are included in the results - empty combinations are omitted rather than showing null or zero values.
111116
* The "top N" values for the ``limit`` parameter are selected based on the sum of values across all time intervals for each distinct field value.

0 commit comments

Comments
 (0)