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

The time difference hours has disappeared with TIMESTAMP WITHOUT TIME ZONE #140

Open
susumuf opened this issue Oct 6, 2023 · 0 comments

Comments

@susumuf
Copy link

susumuf commented Oct 6, 2023

I tried to record nginx access logs in local time(asia/tokyo, UTC+9), but when I wrote to 'TIMESTAMP WITHOUT TIME ZONE', the time difference disappeared.
On the other hand, if you write to TIMESTAMP WITH TIME ZONE, the time difference will be reflected and the data will be recorded correctly.
image

Would someone expert help me out ? or any escape ?

I used this env and config as blow;
fluent.conf

<source>
  @type             tail
  path              /var/log/nginx/access.log
  pos_file          /var/log/nginx/nginx-access.log.pos
  tag               nginx-access
  <parse>
    @type           nginx
  </parse>
</source>
<match nginx-access>
  @type             sql
  host              db
  port              5432
  database          fluentd
  adapter           postgresql
  username          fluentd_rw
  password          fluentd
  <inject>
    time_key        time
    time_type       string
    timezone        Asia/Tokyo
  </inject>
  <table>
    table           nginx_access
    column_mapping  'time:stamp,remote:remote,host:host,method:method,path:path,code:code,size:size,referer:referer,agent:agent,http_x_forwarded_for:http_x_forwarded_for'
  </table>
</match>

env:
fluent-gem list as below;
fluent-config-regexp-type (1.0.0)
fluent-plugin-rewrite-tag-filter (2.4.0)
fluent-plugin-sql (2.3.0)
fluentd (1.16.2)
pg (1.5.4)

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

No branches or pull requests

1 participant