Can you provide me with a hint how to comment out lines in Kibana Dev Tools console? I am interested in comment syntax.
Asked
Active
Viewed 1.4k times
4 Answers
39
Kibana dev tools does not support the comment within the query.
However, you can use #
before or after the query or in-between queries to write a comment.
# This is a comment
GET /_search
{
"query": {
"match_all": {}
}
}
# This is another comment
POST /index/_delete_by_query
{
"query": {
"match": {
"name": "abra ka dabra"
}
}
}

sid8491
- 6,622
- 6
- 38
- 64
8
You can comment out one line at a time by using #
. For instance:
# This is a search command
GET /_search
{
"query": {
"match_all": {}
}
}

kahveci
- 1,429
- 9
- 23
3
If you were to comment out a line or lines, you could add /* */
, for example, /* "field": "statType.keyword" */
GET /exercise-index/_search
{
"_source": {
"includes": ["content"]
},
"query": {
"exists": {"field": "inclination"}
},
"aggs": {
"location": {
"terms": {
"field": "location"
/* "size": 10 */
}
}
}
}
at the query above, we commented out a line in agg with /* */
.
PS:
- The syntax check will fail after you add
/* */
on a line, but it does not affect the query. - After add
/* */
, you need to remove comma at the line before to meet the json syntax.

buxizhizhoum
- 1,719
- 1
- 23
- 32
-
This didn't work for me (version 6.5.1) – Malcolm Oct 10 '22 at 18:32
0
Kibana 8.6 definitely supports //
(double slash) as a way of commenting a line and leaving a text comment right inside a query:
GET edge-rsas-access-prod/_search?size=0
{
"query": {
"range": {
"@timestamp": {
"lt": "now-1d/d" // setting a timeframe
}
}
}
}

idrv
- 1