Coder Social home page Coder Social logo

Comments (6)

Algunenano avatar Algunenano commented on June 25, 2024

This is expected. The client is doing the parsing and has different settings.

Related #56976

from clickhouse.

pushpenderjindal avatar pushpenderjindal commented on June 25, 2024

what the solutions in that case. how can we fixed that?

from clickhouse.

pushpenderjindal avatar pushpenderjindal commented on June 25, 2024

its working if i remove Z from time stamp timestamp":"2024-05-14T06:24:40.682561117Z

from clickhouse.

Algunenano avatar Algunenano commented on June 25, 2024

https://clickhouse.com/docs/en/interfaces/cli#interfaces_cli_configuration

from clickhouse.

pushpenderjindal avatar pushpenderjindal commented on June 25, 2024

we are using vector-agent to push kubermets logs to CH. so still confused how can change the date_time_input_format to best_effort for the time inserting query by vector-agent?
refering : https://clickhouse.com/docs/en/operations/settings/formats#date_time_input_format
what excatly i need to do to insert

`clickhouse :) SELECT name, value, changed FROM system.settings WHERE name LIKE 'date_time%'

SELECT
name,
value,
changed
FROM system.settings
WHERE name LIKE 'date_time%'

Query id: 641252ca-e14a-4706-b248-da7207b62381

┌─name────────────────────────┬─value───────┬─changed─┐

  1. │ date_time_input_format │ best_effort │ 1 │
  2. │ date_time_output_format │ iso │ 1 │
  3. │ date_time_overflow_behavior │ ignore │ 0 │
    └─────────────────────────────┴─────────────┴─────────┘

3 rows in set. Elapsed: 0.002 sec. Processed 1.01 thousand rows, 222.85 KB (602.90 thousand rows/s., 133.03 MB/s.)
Peak memory usage: 0.00 B.

clickhouse :) INSERT INTO newtable3 FORMAT JSONEachRow {"file":"/example/path.log","timestamp":"2024-05-14T06:24:40.682561117Z","kubernetes_container_id":"example_id","stream":"stdout"}

INSERT INTO newtable3 FORMAT JSONEachRow

Query id: a0cd7e37-d808-4a45-b82d-73c8719b5c76

Ok.
Exception on client:
Code: 27. DB::Exception: Cannot parse input: expected '"' before: 'Z","kubernetes_container_id":"example_id","stream":"stdout"}': (while reading the value of key timestamp): (at row 1)
: While executing ParallelParsingBlockInputFormat: data for INSERT was parsed from query. (CANNOT_PARSE_INPUT_ASSERTION_FAILED)`

pls ref. DB table schema above

from clickhouse.

den-crane avatar den-crane commented on June 25, 2024

Actually it should work for vector.dev
Because vector works over HTTP and the profile date_time_input_format setting will be applied.

(the problem with the clickhouse-client that it parses the data locally without using profile date_time_input_format, because it has own date_time_input_format, and its not like this in case of HTTP)

Anyway there are various methods to set this setting in vector.dev config.
You can simply use endpoint = "http://localhost:8123?date_time_input_format=best_effort"
OR encoding.timestamp_format = "unix" https://vector.dev/docs/reference/configuration/sinks/websocket/#encoding.timestamp_format

from clickhouse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.