Skip to content

Commit

Permalink
Merge pull request #1090 from liuwenping/release_4.3.1
Browse files Browse the repository at this point in the history
minor: 第三方es中time_field获取失败
  • Loading branch information
liuwenping authored Jun 6, 2022
2 parents 497c6d8 + dc40190 commit 239477c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions apps/log_esquery/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,13 @@ def _init_index_info(*, index_set_id):
index = [x.get("result_table_id", None) for x in index_set_data_obj_list]
indices = ",".join(index)
if scenario_id not in [Scenario.BKDATA, Scenario.LOG]:
time_field_list = [x.get("time_field", None) for x in index_set_data_obj_list]
if len(time_field_list) > 0:
time_field = time_field_list[0]
else:
time_field = None
for x in index_set_data_obj_list:
time_field = x.get("time_field")
if time_field:
break
time_field = time_field or tmp_index_obj.time_field
if time_field is None:
raise BaseSearchIndexSetIdTimeFieldException(
BaseSearchIndexSetIdTimeFieldException.MESSAGE.format(index_set_id=index_set_id)
)
Expand Down

0 comments on commit 239477c

Please sign in to comment.