Skip to content

Commit

Permalink
Correctly read dataset from sample message documents
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed Mar 11, 2020
1 parent aea5ece commit e283dc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ export class LogEntryCategoriesAnalysis {

return {
examples: hits.map(hit => ({
dataset: hit._source['event.dataset'] ?? '',
message: hit._source.message,
dataset: hit._source.event?.dataset ?? '',
message: hit._source.message ?? '',
timestamp: hit.sort[0],
})),
timing: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ export const createLogEntryCategoryExamplesQuery = (
});

export const logEntryCategoryExampleHitRT = rt.type({
_source: rt.type({
'event.dataset': rt.union([rt.string, rt.undefined]),
_source: rt.partial({
event: rt.partial({
dataset: rt.string,
}),
message: rt.string,
}),
sort: rt.tuple([rt.number]),
Expand Down

0 comments on commit e283dc8

Please sign in to comment.