itayB commented on issue #12484:
URL: https://github.com/apache/airflow/issues/12484#issuecomment-1017771758
I found the problem. I have a separate pod for airflow-scheduler and
airflow-webserver.
I added the `AIRFLOW__ELASTICSEARCH__JSON_FORMAT=True` only to the
airflow-scheduler + the workers but not to the airflow-webserver.
I dig into the source code and I found that the webserver [checks][1] for
the `AIRFLOW__ELASTICSEARCH__JSON_FORMAT` as well in order to [transform][2]
the `log_id` in order to clean the dates to the right format:
```
if self.json_format:
data_interval_start = self._clean_date(dag_run.data_interval_start)
data_interval_end = self._clean_date(dag_run.data_interval_end)
execution_date = self._clean_date(dag_run.execution_date)
else:
data_interval_start = dag_run.data_interval_start.isoformat()
data_interval_end = dag_run.data_interval_end.isoformat()
execution_date = dag_run.execution_date.isoformat()
```
Also post the answer in
[SO](https://stackoverflow.com/questions/70787712/airflow-wrong-log-id-format/70791172#70791172)
[1]:
https://github.com/apache/airflow/blob/main/airflow/providers/elasticsearch/log/es_task_handler.py#L111
[2]:
https://github.com/apache/airflow/blob/main/airflow/providers/elasticsearch/log/es_task_handler.py#L108
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]