diff --git a/CHANGELOG.md b/CHANGELOG.md index ac80e98d8..815a42040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan - [#43](https://github.com/kobsio/kobs/pull/43): Fix `hosts` and `gateways` list for VirtualService in the Helm chart. - [#44](https://github.com/kobsio/kobs/pull/44): Add default logo for teams, which is shown when a team doesn't provide a logo and improve metrics lookup for Prometheus plugin. - [#50](https://github.com/kobsio/kobs/pull/50): Fix determination of the root span in the Jaeger plugin. +- [#54](https://github.com/kobsio/kobs/pull/54): Fix fields handling in Elasticsearch plugin. ### Changed diff --git a/app/src/plugins/elasticsearch/ElasticsearchLogs.tsx b/app/src/plugins/elasticsearch/ElasticsearchLogs.tsx index 32364c683..2a708d013 100644 --- a/app/src/plugins/elasticsearch/ElasticsearchLogs.tsx +++ b/app/src/plugins/elasticsearch/ElasticsearchLogs.tsx @@ -107,7 +107,7 @@ const ElasticsearchLogs: React.FunctionComponent = ({ buckets: tmpLogsResponse.bucketsList, documents: parsedLogs, error: '', - fields: getFields(parsedLogs.slice(parsedLogs.length > 10 ? 10 : parsedLogs.length)), + fields: getFields(parsedLogs.length > 10 ? parsedLogs.slice(10) : parsedLogs), hits: tmpLogsResponse.hits, isLoading: false, scrollID: tmpLogsResponse.scrollid, diff --git a/app/src/plugins/elasticsearch/ElasticsearchPage.tsx b/app/src/plugins/elasticsearch/ElasticsearchPage.tsx index 33cec2345..7b91f18a9 100644 --- a/app/src/plugins/elasticsearch/ElasticsearchPage.tsx +++ b/app/src/plugins/elasticsearch/ElasticsearchPage.tsx @@ -25,7 +25,10 @@ const ElasticsearchPage: React.FunctionComponent = ({ name, de // changeOptions is used to change the options for an Elasticsearch query. Instead of directly modifying the options // state we change the URL parameters. const changeOptions = (opts: IElasticsearchOptions): void => { - const fields = opts.fields ? opts.fields.map((field) => `&field=${field}`) : undefined; + const params = new URLSearchParams(location.search); + const fields = opts.fields + ? opts.fields.map((field) => `&field=${field}`) + : params.getAll('field').map((field) => `&field=${field}`); history.push({ pathname: location.pathname,