Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set utc in <parse> section #2555

Closed
skaji opened this issue Aug 13, 2019 · 1 comment · Fixed by #2569
Closed

Cannot set utc in <parse> section #2555

skaji opened this issue Aug 13, 2019 · 1 comment · Fixed by #2569
Labels
bug Something isn't working

Comments

@skaji
Copy link

skaji commented Aug 13, 2019

Describe the bug

Cannot set utc in <parse> section:

❯ cat test.conf
<source>
  @type tail
  path test.log
  pos_file pos
  tag test
  <parse>
    @type json
    utc true
  </parse>
</source>

❯ fluentd --dry-run -c test.conf
2019-08-13 15:38:44 +0900 [info]: parsing config file is succeeded path="test.conf"
2019-08-13 15:38:44 +0900 [info]: starting fluentd-1.6.3 as dry run mode ruby="2.6.3"
2019-08-13 15:38:44 +0900 [error]: config error file="test.conf" error_class=Fluent::ConfigError error="both of utc and localtime are specified, use only one of them"

To Reproduce

  • Prepare test.conf in "Describe the bug"
  • Execute fluentd.

Expected behavior

Use UTC, and be able to run fluentd

Your Environment

  • Fluentd or td-agent version
    ❯ fluentd --version
    fluentd 1.6.3
    
  • Operating system
    ❯ sw_vers
    ProductName:	Mac OS X
    ProductVersion:	10.14.6
    BuildVersion:	18G84
    
  • Kernel version
    ❯ uname -a
    Darwin MBP-19-002 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin
    

Your Configuration

<source>
  @type tail
  path test.log
  pos_file pos
  tag test
  <parse>
    @type json
    utc true
  </parse>
</source>

Your Error Log

2019-08-13 15:38:44 +0900 [error]: config error file="test.conf" error_class=Fluent::ConfigError error="both of utc and localtime are specified, use only one of them"

Additional context

It seems that this bug has been fixed in #1319
Does it becomes a problem again?

@skaji skaji added the bug Something isn't working label Aug 13, 2019
@repeatedly
Copy link
Member

Looks so. The problem line is here

conf['localtime'] = !(Fluent::Config.bool_value(conf['utc']))
and in_tail creates parser_create with conf argument.
So removing utc after converting to localtime or remove conf argument in in_tail resolve this problem. But I'm not sure this change breaks existing environment or not...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants