added a timestamp.timezone configuration in SplunkSinkConnectorConfig#403
added a timestamp.timezone configuration in SplunkSinkConnectorConfig#403VihasMakwana merged 9 commits intosplunk:developfrom
Conversation
| } | ||
| } else { | ||
| SimpleDateFormat df = new SimpleDateFormat(connectorConfig.timestampFormat); | ||
| SimpleDateFormat df = new SimpleDateFormat(connectorConfig.timestampFormat,Locale.ENGLISH); |
There was a problem hiding this comment.
Why do we need locale change?
There was a problem hiding this comment.
without Locale information, in my local build, I get failed from test proceed, because orginally locale set up from system(os) as ko_KR. so I get exception error like this "Unparseable date: "Jun 13 2010 23:11:52.454 UTC".
(there's a English Jun)
I believe that the timestamp format of testcode should be changed or this code needs to be added Locale.ENGLISH.
but that's not my testcode, so I will remove Locale.ENGLISH as it was
| config.put(SplunkSinkConnectorConfig.ENABLE_TIMESTAMP_EXTRACTION_CONF, String.valueOf(true)); | ||
| config.put(SplunkSinkConnectorConfig.REGEX_CONF, "\\\"time\\\":\\s*\\\"(?<time>.*?)\""); | ||
| config.put(SplunkSinkConnectorConfig.TIMESTAMP_FORMAT_CONF, "MMM dd yyyy HH:mm:ss.SSS zzz"); | ||
| // config.put(SplunkSinkConnectorConfig.TIMESTAMP_TIMEZONE_CONF, ""); |
There was a problem hiding this comment.
I think we can remove it, as it defaults to empty string.
|
Can you add test cases covering your config? |
|
@mo-mosh sync develop with your branch, it involves a fix for failing pipeline. |
|
@mo-mosh I can add test cases, if you're occupied. |
|
Hope you don't mind if I raise a PR against your repo? |
|
I don't mind =) and I'll update repo and gonna add test cases |
|
I updated the code like I added only what I need from the origin develop branch |
VihasMakwana
left a comment
There was a problem hiding this comment.
@mo-mosh some comments.
| config.put(SplunkSinkConnectorConfig.ENABLE_TIMESTAMP_EXTRACTION_CONF, String.valueOf(true)); | ||
| config.put(SplunkSinkConnectorConfig.REGEX_CONF, "\\\"REQ_TIME\\\":\\s*\\\"(?<time>.*?)\""); | ||
| config.put(SplunkSinkConnectorConfig.TIMESTAMP_FORMAT_CONF, "yyyyMMddHHmmssSSS"); | ||
| config.put(SplunkSinkConnectorConfig.TIMESTAMP_TIMEZONE_CONF, "Asis/Seoul"); |
There was a problem hiding this comment.
| config.put(SplunkSinkConnectorConfig.TIMESTAMP_TIMEZONE_CONF, "Asis/Seoul"); | |
| config.put(SplunkSinkConnectorConfig.TIMESTAMP_TIMEZONE_CONF, "Asia/Seoul"); |
I have the same issue "Add support for timezone override #398", so I added a timestamp.timezone.
as a default it's the UTC, but in my case I needed to change UTC to Asia/Seoul.