Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

CSM BDS fixes related to date-time format issues #997

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

thanh-lam
Copy link
Member

@thanh-lam thanh-lam commented Mar 4, 2021

Purpose

Fixes for issues #992 #995.
The mutate filter plugin gsub in logstash changes the date field it reads into the desired format before writing it to Elasticsearch index: cast-allocation. With this change in date format, those python scripts that use the old format have to be changed to use the new format:

	modified:   csm_big_data/logstash/config/logstash.conf
	modified:   csm_big_data/python/findJobKeys.py
	modified:   csm_big_data/python/findJobMetrics.py
	modified:   csm_big_data/python/findJobTimeRange.py

Approach

Updated logstash.conf file and modified python scripts in /opt/ibm/csm/csm_big_data/python/.

Origin

#992
#995

How to Test

For the logstash.conf file:

  1. Copy CAST/csm_big_data/logstash/config/logstash.conf to /etc/logstash/conf.d/logstash.conf
  2. Restart logstash: "systemctl restart logstash"

For the scripts, just try to run them in usual tests.

Open Questions and Pre-Merge TODOs

@thanh-lam thanh-lam added this to the CS21B milestone Mar 4, 2021
@williammorrison2 williammorrison2 changed the title CSM BDS fixes related to date-time format issues #992 #995 CSM BDS fixes related to date-time format issues Mar 4, 2021
@thanh-lam
Copy link
Member Author

@besawn , I checked in an "urgent" fix late yesterday for changing TIME_SEARCH_FORMAT in cast_helper.py

#TIME_SEARCH_FORMAT = "epoch_millis"
TIME_SEARCH_FORMAT = "strict_date_optional_time_nanos"

This fixes the problem of Elasticsearch query by time range. Part of this time range query not working was due to the search time format in epoch_millis but the date+time format of "begin_time" and "end_time" are in nano seconds.

@williammorrison2 and I tested this fix yesterday and it worked very well. So we didn't want to miss this PR. Changing TIME_SEARCH_FORMAT also led to eliminating the call to convert_time(). Another effect of this fix is that: User has to input "complete" time format for --starttime and --endtime. For example:

"2021-03-08T16:00:00" instead of "2021-03-08T16".

I'll add comments into #992 to document this fix.

Copy link
Contributor

@williammorrison2 williammorrison2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files look good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants