Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META]Add help command to PPL for a descriptive of grammar #3012

Open
YANG-DB opened this issue Sep 12, 2024 · 0 comments
Open

[META]Add help command to PPL for a descriptive of grammar #3012

YANG-DB opened this issue Sep 12, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request PPL Piped processing language

Comments

@YANG-DB
Copy link
Member

YANG-DB commented Sep 12, 2024

Is your feature request related to a problem?
A simple self contained way to get the PPL grammar description and usage example, this would also allow new users to get basic understanding of the language and its functionality

What solution would you like?
The next example reviews the trendline command:

>> help trendline

DESCRIPTION
    Computes moving averages of fields: simple moving average (SMA) and weighted moving average (WMA). The output is written to a new field.

SYNTAX
    trendline <trendtype>(<period>, <field>) [AS <newfield>] [, ...]

ARGUMENTS
    trendtype    (Required) The type of trend to compute. Supported types:
                 sma: Simple Moving Average
                 wma: Weighted Moving Average

    period       (Required) An integer between 2 and 10000 representing the period over which to compute the trend.

    field        (Required) The name of the field on which to calculate the trend.

    newfield     (Optional) The name of the new field to store the result. If not specified, defaults to <trendtype><period>(<field>).

USAGE EXAMPLE
    source=cpu_metrics 
    | where host='webserver01' 
    | trendline sma(5, cpu_usage) AS smooth_cpu, wma(10, memory_usage) AS mem_trend 
    | stats avg(smooth_cpu), max(mem_trend) by date_histogram(timestamp, '1h')

Support for PPL help functionality is required for both:

- OpenSearch based PPL engine

- Spark based PPL engine

Do you have any additional context?
Add any other context or screenshots about the feature request here.

@YANG-DB YANG-DB added documentation Improvements or additions to documentation enhancement New feature or request untriaged PPL Piped processing language labels Sep 12, 2024
@YANG-DB YANG-DB self-assigned this Sep 12, 2024
@YANG-DB YANG-DB removed the untriaged label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request PPL Piped processing language
Projects
None yet
Development

No branches or pull requests

1 participant