Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update query for Elasticsearch 7.x
With Elasticsearch 7.x or Open Distro for Elasticsearch 1.x,
Invalid query parameter is updated
  • Loading branch information
inggilove authored Aug 23, 2020
commit 72b9fa400e82fd35ed2d1b7de967ac6e4c660a43
21 changes: 11 additions & 10 deletions src/pages/kb/data-sources/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ source of type `Elasticsearch`.
{
"index": "twitter",
"query": "user:kimchy",
"fields": ["@timestamp", "tweet", "user"],
"limit": 15,
"sort": "@timestamp:asc"
"_source": ["@timestamp", "tweet", "user"],
"size": 15,
"sort": {"@timestamp:asc"}
}
```
- In Elasticsearch of 6.x or lower, "_source" parameter should be "field" and "size" be "limit".


## Simple query on a logstash Elasticsearch instance:
Expand All @@ -42,9 +43,9 @@ source of type `Elasticsearch`.
{
"index": "logstash-2015.04.*",
"query": "type:events AND eventName:UserUpgrade AND channel:selfserve",
"fields": ["@timestamp", "userId", "channel", "utm_source", "utm_medium", "utm_campaign", "utm_content"],
"limit": 250,
"sort": "@timestamp:asc"
"_source": ["@timestamp", "userId", "channel", "utm_source", "utm_medium", "utm_campaign", "utm_content"],
"size": 250,
"sort": {"@timestamp:asc"}
}
```

Expand All @@ -64,12 +65,12 @@ source of type `Elasticsearch`.
"user": "kimchy"
}
},
"fields": ["@timestamp", "tweet", "user"],
"limit": 15,
"sort": "@timestamp:asc"
"_source": ["@timestamp", "tweet", "user"],
"size": 15,
"sort": {"@timestamp:asc"}
}
```

## A note on authentication

Redash has two data sources available for Elasticsearch. You need to use the Amazon Elasticsearch service source if you're using IAM based authentication. Otherwise, use the standard data source.
Redash has two data sources available for Elasticsearch. You need to use the Amazon Elasticsearch service source if you're using IAM based authentication. Otherwise, use the standard data source.