Skip to content

Commit

Permalink
Update visualisation to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova committed Jul 15, 2020
1 parent e225b76 commit 3687e94
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class ElasticResponse {
if (response.hits && response.hits.hits.length > 0) {
const { propNames, docs } = flattenHits(response.hits.hits);
if (docs.length > 0) {
const series = createEmptyDataFrame(propNames, this.targets[0].timeField, logMessageField, logLevelField);
let series = createEmptyDataFrame(propNames, this.targets[0].timeField, logMessageField, logLevelField);

// Add a row for each document
for (const doc of docs) {
Expand All @@ -429,8 +429,10 @@ export class ElasticResponse {

series.add(doc);
}
const seriesWithVis = addPreferredVisualisationType(series, 'graph');
dataFrame.push(seriesWithVis);
if (isLogsRequest) {
series = addPreferredVisualisationType(series, 'logs');
}
dataFrame.push(series);
}
}

Expand Down

0 comments on commit 3687e94

Please sign in to comment.