forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…astic#199646) ## Summary Closes elastic#199480 This fixes `GROK` and `DISSECT` command pretty-printing, in, both, `BasicPrettyPrinter` and `WrappingPrettyPrinting`. The two commands are special, because unlike all other commands they exhibit these two traits: 1. Command arguments are not separated by comma (in all other commands arguments are separated by comma). 2. Command option label is separated by `=` from the option value (in all other commands it is just a space). ``` DISSECT input "pattern" APPEND_SEPARATOR = "separator" | | | | no comma? | | equals sign? ``` ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### For maintainers - [x] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- Loading branch information
1 parent
c611e52
commit 2277e64
Showing
5 changed files
with
169 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
/** | ||
* This set tracks commands that don't use commas to separate their | ||
* arguments. | ||
* | ||
* Normally ES|QL command arguments are separated by commas. | ||
* | ||
* ``` | ||
* COMMAND arg1, arg2, arg3 | ||
* ``` | ||
* | ||
* But there are some commands (namely `grok` and `dissect`) which don't | ||
* use commas to separate their arguments. | ||
* | ||
* ``` | ||
* GROK input "pattern" | ||
* DISSECT input "pattern" | ||
* ``` | ||
*/ | ||
export const commandsWithNoCommaArgSeparator = new Set(['grok', 'dissect']); | ||
|
||
/** | ||
* This set tracks command options which use an equals sign to separate | ||
* the option label from the option value. | ||
* | ||
* Most ES|QL commands use a space to separate the option label from the | ||
* option value. | ||
* | ||
* ``` | ||
* COMMAND arg1, arg2, arg3 OPTION option | ||
* FROM index METADATA _id | ||
* ``` | ||
* | ||
* However, the `APPEND_SEPARATOR` in the `DISSECT` command uses an equals | ||
* sign to separate the option label from the option value. | ||
* | ||
* ``` | ||
* DISSECT input "pattern" APPEND_SEPARATOR = "separator" | ||
* | | ||
* | | ||
* equals sign | ||
* ``` | ||
*/ | ||
export const commandOptionsWithEqualsSeparator = new Set(['append_separator']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters