Skip to content

Commit

Permalink
fix: add default timestamp field
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Dec 27, 2023
1 parent cdbcfa4 commit b511e16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions public/components/custom_panels/helpers/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ const queryAccumulator = (
}
const indexPartOfQuery = indexMatchArray[0];
const filterPartOfQuery = originalQuery.replace(PPL_INDEX_REGEX, '');
const timeQueryFilter = ` | where ${timestampField} >= '${convertDateTime(
const finalTimestampField = timestampField || 'timestamp';
const timeQueryFilter = ` | where ${finalTimestampField} >= '${convertDateTime(
startTime
)}' and ${timestampField} <= '${convertDateTime(endTime, false)}'`;
)}' and ${finalTimestampField} <= '${convertDateTime(endTime, false)}'`;
const pplFilterQuery = panelFilterQuery === '' ? '' : ` | ${panelFilterQuery}`;

return indexPartOfQuery + timeQueryFilter + pplFilterQuery + filterPartOfQuery;
Expand Down

0 comments on commit b511e16

Please sign in to comment.