diff --git a/app/vlinsert/insertutils/timestamp.go b/app/vlinsert/insertutils/timestamp.go index b75e5f559..ec546bcd8 100644 --- a/app/vlinsert/insertutils/timestamp.go +++ b/app/vlinsert/insertutils/timestamp.go @@ -7,19 +7,19 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/lib/logstorage" ) -// ExtractTimestampISO8601FromFields extracts ISO8601 timestamp in nanoseconds from the field with the name timeField at fields. +// ExtractTimestampRFC3339NanoFromFields extracts RFC3339 timestamp in nanoseconds from the field with the name timeField at fields. // // The value for the timeField is set to empty string after returning from the function, // so it could be ignored during data ingestion. // // The current timestamp is returned if fields do not contain a field with timeField name or if the timeField value is empty. -func ExtractTimestampISO8601FromFields(timeField string, fields []logstorage.Field) (int64, error) { +func ExtractTimestampRFC3339NanoFromFields(timeField string, fields []logstorage.Field) (int64, error) { for i := range fields { f := &fields[i] if f.Name != timeField { continue } - nsecs, ok := logstorage.TryParseTimestampISO8601(f.Value) + nsecs, ok := logstorage.TryParseTimestampRFC3339Nano(f.Value) if !ok { if f.Value == "0" || f.Value == "" { return time.Now().UnixNano(), nil diff --git a/app/vlinsert/jsonline/jsonline.go b/app/vlinsert/jsonline/jsonline.go index f7be0f622..10df87367 100644 --- a/app/vlinsert/jsonline/jsonline.go +++ b/app/vlinsert/jsonline/jsonline.go @@ -112,7 +112,7 @@ func readLine(sc *bufio.Scanner, timeField, msgField string, lmp insertutils.Log if err := p.ParseLogMessage(line); err != nil { return false, fmt.Errorf("cannot parse json-encoded log entry: %w", err) } - ts, err := insertutils.ExtractTimestampISO8601FromFields(timeField, p.Fields) + ts, err := insertutils.ExtractTimestampRFC3339NanoFromFields(timeField, p.Fields) if err != nil { return false, fmt.Errorf("cannot get timestamp: %w", err) } diff --git a/app/vlinsert/syslog/syslog.go b/app/vlinsert/syslog/syslog.go index a6176673b..0a4f7cb03 100644 --- a/app/vlinsert/syslog/syslog.go +++ b/app/vlinsert/syslog/syslog.go @@ -485,7 +485,7 @@ func processLine(line []byte, currentYear int, timezone *time.Location, lmp inse p := logstorage.GetSyslogParser(currentYear, timezone) lineStr := bytesutil.ToUnsafeString(line) p.Parse(lineStr) - ts, err := insertutils.ExtractTimestampISO8601FromFields("timestamp", p.Fields) + ts, err := insertutils.ExtractTimestampRFC3339NanoFromFields("timestamp", p.Fields) if err != nil { return fmt.Errorf("cannot get timestamp from syslog line %q: %w", line, err) } diff --git a/deployment/docker/docker-compose-victorialogs.yml b/deployment/docker/docker-compose-victorialogs.yml index d8626bf63..9d75061a1 100644 --- a/deployment/docker/docker-compose-victorialogs.yml +++ b/deployment/docker/docker-compose-victorialogs.yml @@ -42,7 +42,7 @@ services: # storing logs and serving read queries. victorialogs: container_name: victorialogs - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs command: - "--storageDataPath=/vlogs" - "--httpListenAddr=:9428" diff --git a/deployment/docker/victorialogs/filebeat-docker/docker-compose.yml b/deployment/docker/victorialogs/filebeat-docker/docker-compose.yml index 3e447fb11..e6fe2982f 100644 --- a/deployment/docker/victorialogs/filebeat-docker/docker-compose.yml +++ b/deployment/docker/victorialogs/filebeat-docker/docker-compose.yml @@ -22,7 +22,7 @@ services: - -beat.uri=http://filebeat-victorialogs:5066 victorialogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - victorialogs-filebeat-docker-vl:/vlogs ports: diff --git a/deployment/docker/victorialogs/filebeat-syslog/docker-compose.yml b/deployment/docker/victorialogs/filebeat-syslog/docker-compose.yml index 333ada62b..1ee1f9f48 100644 --- a/deployment/docker/victorialogs/filebeat-syslog/docker-compose.yml +++ b/deployment/docker/victorialogs/filebeat-syslog/docker-compose.yml @@ -13,7 +13,7 @@ services: - "5140:5140" victorialogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - victorialogs-filebeat-syslog-vl:/vlogs ports: diff --git a/deployment/docker/victorialogs/fluentbit-docker/docker-compose.yml b/deployment/docker/victorialogs/fluentbit-docker/docker-compose.yml index 70f26bdf3..b75b46e68 100644 --- a/deployment/docker/victorialogs/fluentbit-docker/docker-compose.yml +++ b/deployment/docker/victorialogs/fluentbit-docker/docker-compose.yml @@ -11,7 +11,7 @@ services: - "5140:5140" victorialogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - victorialogs-fluentbit-vl:/vlogs ports: diff --git a/deployment/docker/victorialogs/logstash/docker-compose.yml b/deployment/docker/victorialogs/logstash/docker-compose.yml index c6b7b3ae9..3842adce3 100644 --- a/deployment/docker/victorialogs/logstash/docker-compose.yml +++ b/deployment/docker/victorialogs/logstash/docker-compose.yml @@ -14,7 +14,7 @@ services: - "5140:5140" victorialogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - victorialogs-logstash-vl:/vlogs ports: diff --git a/deployment/docker/victorialogs/promtail/docker-compose.yml b/deployment/docker/victorialogs/promtail/docker-compose.yml index c4fe36041..471f7c616 100644 --- a/deployment/docker/victorialogs/promtail/docker-compose.yml +++ b/deployment/docker/victorialogs/promtail/docker-compose.yml @@ -12,7 +12,7 @@ services: - "5140:5140" vlogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - victorialogs-promtail-docker:/vlogs ports: diff --git a/deployment/docker/victorialogs/vector-docker/docker-compose.yml b/deployment/docker/victorialogs/vector-docker/docker-compose.yml index 8648e5816..087c68cec 100644 --- a/deployment/docker/victorialogs/vector-docker/docker-compose.yml +++ b/deployment/docker/victorialogs/vector-docker/docker-compose.yml @@ -22,7 +22,7 @@ services: condition: service_healthy victorialogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - victorialogs-vector-docker-vl:/vlogs ports: diff --git a/deployment/logs-benchmark/docker-compose.yml b/deployment/logs-benchmark/docker-compose.yml index 67f28f3ef..3323672ff 100644 --- a/deployment/logs-benchmark/docker-compose.yml +++ b/deployment/logs-benchmark/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: # Run `make package-victoria-logs` to build victoria-logs image vlogs: - image: docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + image: docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs volumes: - vlogs:/vlogs ports: diff --git a/docs/VictoriaLogs/CHANGELOG.md b/docs/VictoriaLogs/CHANGELOG.md index a1e12112f..3b47cbca4 100644 --- a/docs/VictoriaLogs/CHANGELOG.md +++ b/docs/VictoriaLogs/CHANGELOG.md @@ -19,6 +19,12 @@ according to [these docs](https://docs.victoriametrics.com/victorialogs/quicksta ## tip +## [v0.20.2](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.20.2-victorialogs) + +Released at 2024-06-19 + +* BUGFIX: properly parse timestamps with nanosecond precision for logs ingested via [jsonline format](https://docs.victoriametrics.com/victorialogs/data-ingestion/#json-stream-api). The bug has been introduced in [v0.20.0 release](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.20.0-victorialogs). + ## [v0.20.1](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.20.1-victorialogs) Released at 2024-06-18 diff --git a/docs/VictoriaLogs/QuickStart.md b/docs/VictoriaLogs/QuickStart.md index 0d78ecab7..7cc97cb87 100644 --- a/docs/VictoriaLogs/QuickStart.md +++ b/docs/VictoriaLogs/QuickStart.md @@ -36,8 +36,8 @@ Just download archive for the needed Operating system and architecture, unpack i For example, the following commands download VictoriaLogs archive for Linux/amd64, unpack and run it: ```sh -curl -L -O https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v0.20.1-victorialogs/victoria-logs-linux-amd64-v0.20.1-victorialogs.tar.gz -tar xzf victoria-logs-linux-amd64-v0.20.1-victorialogs.tar.gz +curl -L -O https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v0.20.2-victorialogs/victoria-logs-linux-amd64-v0.20.2-victorialogs.tar.gz +tar xzf victoria-logs-linux-amd64-v0.20.2-victorialogs.tar.gz ./victoria-logs-prod ``` @@ -61,7 +61,7 @@ Here is the command to run VictoriaLogs in a Docker container: ```sh docker run --rm -it -p 9428:9428 -v ./victoria-logs-data:/victoria-logs-data \ - docker.io/victoriametrics/victoria-logs:v0.20.1-victorialogs + docker.io/victoriametrics/victoria-logs:v0.20.2-victorialogs ``` See also: