Skip to content

Commit

Permalink
Elasticsearch: Add support for date_nanos type (#27538)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elfo404 committed Sep 17, 2020
1 parent e86ff52 commit 0e34474
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ describe('ElasticDatasource', function(this: any) {
properties: {
'@timestamp': { type: 'date' },
__timestamp: { type: 'date' },
'@timestampnano': { type: 'date_nanos' },
beat: {
properties: {
name: {
Expand Down Expand Up @@ -431,6 +432,7 @@ describe('ElasticDatasource', function(this: any) {
expect(fields).toEqual([
'@timestamp',
'__timestamp',
'@timestampnano',
'beat.name.raw',
'beat.name',
'beat.hostname',
Expand Down Expand Up @@ -460,7 +462,7 @@ describe('ElasticDatasource', function(this: any) {
});

const fields = _.map(fieldObjects, 'text');
expect(fields).toEqual(['@timestamp', '__timestamp']);
expect(fields).toEqual(['@timestamp', '__timestamp', '@timestampnano']);
});
});

Expand Down
1 change: 1 addition & 0 deletions public/app/plugins/datasource/elasticsearch/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ export class ElasticDatasource extends DataSourceApi<ElasticsearchQuery, Elastic
integer: 'number',
long: 'number',
date: 'date',
date_nanos: 'date',
string: 'string',
text: 'string',
scaled_float: 'number',
Expand Down

0 comments on commit 0e34474

Please sign in to comment.