Repository: VictoriaMetrics/VictoriaMetrics
Pull request #7124 (2024-09-27 13:19:48)

renamed not executable compose files
### Describe Your Changes

Renamed base compose files to prevent envs to be created from them

### Checklist

The following checks are **mandatory**:

- [ ] My change adheres [VictoriaMetrics contributing guidelines](https://docs.victoriametrics.com/contributing/).



Patch:
diff --git a/app/vlinsert/elasticsearch/elasticsearch.go b/app/vlinsert/elasticsearch/elasticsearch.go
index 280ba007e..fff9f19be 100644
--- a/app/vlinsert/elasticsearch/elasticsearch.go
+++ b/app/vlinsert/elasticsearch/elasticsearch.go
@@ -6,9 +6,7 @@ import (
 	"flag"
 	"fmt"
 	"io"
-	"math"
 	"net/http"
-	"strconv"
 	"strings"
 	"time"
 
@@ -251,19 +249,8 @@ func parseElasticsearchTimestamp(s string) (int64, error) {
 		return 0, nil
 	}
 	if len(s) < len("YYYY-MM-DD") || s[len("YYYY")] != '-' {
-		// Try parsing timestamp in milliseconds
-		n, err := strconv.ParseInt(s, 10, 64)
-		if err != nil {
-			return 0, fmt.Errorf("cannot parse timestamp in milliseconds from %q: %w", s, err)
-		}
-		if n > int64(math.MaxInt64)/1e6 {
-			return 0, fmt.Errorf("too big timestamp in milliseconds: %d; mustn't exceed %d", n, int64(math.MaxInt64)/1e6)
-		}
-		if n < int64(math.MinInt64)/1e6 {
-			return 0, fmt.Errorf("too small timestamp in milliseconds: %d; must be bigger than %d", n, int64(math.MinInt64)/1e6)
-		}
-		n *= 1e6
-		return n, nil
+		// Try parsing timestamp in seconds or milliseconds
+		return insertutils.ParseUnixTimestamp(s)
 	}
 	if len(s) == len("YYYY-MM-DD") {
 		t, err := time.Parse("2006-01-02", s)
diff --git a/app/vlinsert/insertutils/timestamp.go b/app/vlinsert/insertutils/timestamp.go
index e9d41d0a4..978837d09 100644
--- a/app/vlinsert/insertutils/timestamp.go
+++ b/app/vlinsert/insertutils/timestamp.go
@@ -2,6 +2,8 @@ package insertutils
 
 import (
 	"fmt"
+	"math"
+	"strconv"
 	"time"
 
 	"github.com/VictoriaMetrics/VictoriaMetrics/lib/logstorage"
@@ -19,15 +21,49 @@ func ExtractTimestampRFC3339NanoFromFields(timeField string, fields []logstorage
 		if f.Name != timeField {
 			continue
 		}
-		if f.Value == "" || f.Value == "0" {
-			return time.Now().UnixNano(), nil
-		}
-		nsecs, ok := logstorage.TryParseTimestampRFC3339Nano(f.Value)
-		if !ok {
-			return 0, fmt.Errorf("cannot unmarshal rfc3339 timestamp from %s=%q", timeField, f.Value)
+		nsecs, err := parseTimestamp(f.Value)
+		if err != nil {
+			return 0, fmt.Errorf("cannot parse timestamp from field %q: %s", timeField, err)
 		}
 		f.Value = ""
+		if nsecs == 0 {
+			nsecs = time.Now().UnixNano()
+		}
 		return nsecs, nil
 	}
 	return time.Now().UnixNano(), nil
 }
+
+func parseTimestamp(s string) (int64, error) {
+	if s == "" || s == "0" {
+		return time.Now().UnixNano(), nil
+	}
+	if len(s) <= len("YYYY") || s[len("YYYY")] != '-' {
+		return ParseUnixTimestamp(s)
+	}
+	nsecs, ok := logstorage.TryParseTimestampRFC3339Nano(s)
+	if !ok {
+		return 0, fmt.Errorf("cannot unmarshal rfc3339 timestamp %q", s)
+	}
+	return nsecs, nil
+}
+
+// ParseUnixTimestamp parses s as unix timestamp in either seconds or milliseconds and returns the parsed timestamp in nanoseconds.
+func ParseUnixTimestamp(s string) (int64, error) {
+	n, err := strconv.ParseInt(s, 10, 64)
+	if err != nil {
+		return 0, fmt.Errorf("cannot parse unix timestamp from %q: %w", s, err)
+	}
+	if n < (1<<31) && n >= (-1<<31) {
+		// The timestamp is in seconds. Convert it to milliseconds
+		n *= 1e3
+	}
+	if n > int64(math.MaxInt64)/1e6 {
+		return 0, fmt.Errorf("too big timestamp in milliseconds: %d; mustn't exceed %d", n, int64(math.MaxInt64)/1e6)
+	}
+	if n < int64(math.MinInt64)/1e6 {
+		return 0, fmt.Errorf("too small timestamp in milliseconds: %d; must be bigger than %d", n, int64(math.MinInt64)/1e6)
+	}
+	n *= 1e6
+	return n, nil
+}
diff --git a/deployment/docker/docker-compose-cluster.yml b/deployment/docker/docker-compose-cluster.yml
index 06e76d88d..a00bbc0ff 100644
--- a/deployment/docker/docker-compose-cluster.yml
+++ b/deployment/docker/docker-compose-cluster.yml
@@ -28,7 +28,7 @@ services:
     restart: always
     volumes:
       - grafanadata:/var/lib/grafana
-      - ./provisioning/datasources/prometheus-datasource:/etc/grafana/provisioning/datasources
+      - ./provisioning/datasources/prometheus-datasource/cluster.yml:/etc/grafana/provisioning/datasources/cluster.yml
       - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
       - ./../../dashboards/victoriametrics-cluster.json:/var/lib/grafana/dashboards/vm.json
       - ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json
diff --git a/deployment/docker/docker-compose.yml b/deployment/docker/docker-compose.yml
index 896d64537..b6fbdb3d9 100644
--- a/deployment/docker/docker-compose.yml
+++ b/deployment/docker/docker-compose.yml
@@ -53,7 +53,7 @@ services:
       - 3000:3000
     volumes:
       - grafanadata:/var/lib/grafana
-      - ./provisioning/datasources/prometheus-datasource:/etc/grafana/provisioning/datasources
+      - ./provisioning/datasources/prometheus-datasource/single.yml:/etc/grafana/provisioning/datasources/single.yml
       - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
       - ./../../dashboards/victoriametrics.json:/var/lib/grafana/dashboards/vm.json
       - ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json
diff --git a/deployment/docker/provisioning/datasources/prometheus-datasource/prometheus-datasource.yml b/deployment/docker/provisioning/datasources/prometheus-datasource/cluster.yml
similarity index 54%
rename from deployment/docker/provisioning/datasources/prometheus-datasource/prometheus-datasource.yml
rename to deployment/docker/provisioning/datasources/prometheus-datasource/cluster.yml
index 9b768a337..f8bb30ab4 100644
--- a/deployment/docker/provisioning/datasources/prometheus-datasource/prometheus-datasource.yml
+++ b/deployment/docker/provisioning/datasources/prometheus-datasource/cluster.yml
@@ -1,20 +1,11 @@
 apiVersion: 1
 
 datasources:
-    - name: VictoriaMetrics
-      type: prometheus
-      access: proxy
-      url: http://victoriametrics:8428
-      isDefault: true
-      jsonData:
-        prometheusType: Prometheus
-        prometheusVersion: 2.24.0
-
     - name: VictoriaMetrics - cluster
       type: prometheus
       access: proxy
       url: http://vmauth:8427/select/0/prometheus
-      isDefault: false
+      isDefault: true
       jsonData:
         prometheusType: Prometheus
         prometheusVersion: 2.24.0
diff --git a/deployment/docker/provisioning/datasources/prometheus-datasource/single.yml b/deployment/docker/provisioning/datasources/prometheus-datasource/single.yml
new file mode 100644
index 000000000..ab80245bf
--- /dev/null
+++ b/deployment/docker/provisioning/datasources/prometheus-datasource/single.yml
@@ -0,0 +1,11 @@
+apiVersion: 1
+
+datasources:
+    - name: VictoriaMetrics
+      type: prometheus
+      access: proxy
+      url: http://victoriametrics:8428
+      isDefault: true
+      jsonData:
+        prometheusType: Prometheus
+        prometheusVersion: 2.24.0
\ No newline at end of file
diff --git a/deployment/docker/provisioning/datasources/victoriametrics-datasource/cluster.yml b/deployment/docker/provisioning/datasources/victoriametrics-datasource/cluster.yml
new file mode 100644
index 000000000..7eefe6d47
--- /dev/null
+++ b/deployment/docker/provisioning/datasources/victoriametrics-datasource/cluster.yml
@@ -0,0 +1,13 @@
+apiVersion: 1
+
+datasources:
+  - name: VictoriaMetrics - cluster
+    type: victoriametrics-datasource
+    access: proxy
+    url: http://vmauth:8427/select/0/prometheus
+    isDefault: true
+    # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data
+    jsonData:
+      # vmuiUrl will auto resolve into http://vmauth:8427 and won't work at user's machine
+      # so we override it
+      vmuiUrl: http://localhost:8427/select/0/vmui
diff --git a/deployment/docker/provisioning/datasources/victoriametrics-datasource/single.yml b/deployment/docker/provisioning/datasources/victoriametrics-datasource/single.yml
new file mode 100644
index 000000000..c04a48dd6
--- /dev/null
+++ b/deployment/docker/provisioning/datasources/victoriametrics-datasource/single.yml
@@ -0,0 +1,13 @@
+apiVersion: 1
+
+datasources:
+  - name: VictoriaMetrics
+    type: victoriametrics-datasource
+    access: proxy
+    url: http://victoriametrics:8428
+    isDefault: true
+    # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data
+    jsonData:
+      # vmuiUrl will auto resolve into http://victoriametrics:8428 and won't work at user's machine
+      # so we override it
+      vmuiUrl: http://localhost:8428/vmui
\ No newline at end of file
diff --git a/deployment/docker/provisioning/datasources/victoriametrics-datasource/victoriametrics-datasource.yml b/deployment/docker/provisioning/datasources/victoriametrics-datasource/victoriametrics-datasource.yml
deleted file mode 100644
index 64468980f..000000000
--- a/deployment/docker/provisioning/datasources/victoriametrics-datasource/victoriametrics-datasource.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-apiVersion: 1
-
-# List of data sources to insert/update depending on what's
-# available in the database.
-datasources:
-  # <string, required> Name of the VictoriaMetrics datasource
-  # displayed in Grafana panels and queries.
-  - name: VictoriaMetrics
-    # <string, required> Sets the data source type.
-    type: victoriametrics-datasource
-      # <string, required> Sets the access mode, either
-      # proxy or direct (Server or Browser in the UI).
-    # Some data sources are incompatible with any setting
-    # but proxy (Server).
-    access: proxy
-    # <string> Sets default URL of the single node version of VictoriaMetrics
-    url: http://victoriametrics:8428
-    # <string> Sets the pre-selected datasource for new panels.
-    # You can set only one default data source per organization.
-    isDefault: true
-    # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data
-    jsonData:
-      # vmuiUrl will auto resolve into http://victoriametrics:8428 and won't work at user's machine
-      # so we override it
-      vmuiUrl: http://localhost:8428/vmui
-
-    # <string, required> Name of the VictoriaMetrics datasource
-    # displayed in Grafana panels and queries.
-  - name: VictoriaMetrics - cluster
-    # <string, required> Sets the data source type.
-    type: victoriametrics-datasource
-    # <string, required> Sets the access mode, either
-    # proxy or direct (Server or Browser in the UI).
-    # Some data sources are incompatible with any setting
-    # but proxy (Server).
-    access: proxy
-    # <string> Sets default URL of the cluster version of VictoriaMetrics
-    url: http://vmauth:8427/select/0/prometheus
-    # <string> Sets the pre-selected datasource for new panels.
-    # You can set only one default data source per organization.
-    isDefault: false
-    # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data
-    jsonData:
-      # vmuiUrl will auto resolve into http://vmauth:8427 and won't work at user's machine
-      # so we override it
-      vmuiUrl: http://localhost:8427/select/0/vmui
diff --git a/deployment/docker/victorialogs/compose.yml b/deployment/docker/victorialogs/compose-base.yml
similarity index 100%
rename from deployment/docker/victorialogs/compose.yml
rename to deployment/docker/victorialogs/compose-base.yml
diff --git a/deployment/docker/victorialogs/filebeat/compose.yml b/deployment/docker/victorialogs/filebeat/compose-base.yml
similarity index 95%
rename from deployment/docker/victorialogs/filebeat/compose.yml
rename to deployment/docker/victorialogs/filebeat/compose-base.yml
index 0b3b38359..4da2cccc0 100644
--- a/deployment/docker/victorialogs/filebeat/compose.yml
+++ b/deployment/docker/victorialogs/filebeat/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   filebeat:
     image: docker.elastic.co/beats/filebeat:8.15.1
diff --git a/deployment/docker/victorialogs/filebeat/elasticsearch/compose.yml b/deployment/docker/victorialogs/filebeat/elasticsearch/compose.yml
index f15e3b2f5..23e245b02 100644
--- a/deployment/docker/victorialogs/filebeat/elasticsearch/compose.yml
+++ b/deployment/docker/victorialogs/filebeat/elasticsearch/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: filebeat-elasticsearch
diff --git a/deployment/docker/victorialogs/filebeat/syslog/compose.yml b/deployment/docker/victorialogs/filebeat/syslog/compose.yml
index eb908fd0c..5d38d1a17 100644
--- a/deployment/docker/victorialogs/filebeat/syslog/compose.yml
+++ b/deployment/docker/victorialogs/filebeat/syslog/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: filebeat-syslog
diff --git a/deployment/docker/victorialogs/fluentbit/compose.yml b/deployment/docker/victorialogs/fluentbit/compose-base.yml
similarity index 92%
rename from deployment/docker/victorialogs/fluentbit/compose.yml
rename to deployment/docker/victorialogs/fluentbit/compose-base.yml
index 2f38c9f20..c9580679f 100644
--- a/deployment/docker/victorialogs/fluentbit/compose.yml
+++ b/deployment/docker/victorialogs/fluentbit/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   fluentbit:
     image: cr.fluentbit.io/fluent/fluent-bit:3.1.7
diff --git a/deployment/docker/victorialogs/fluentbit/jsonline-ha/compose.yml b/deployment/docker/victorialogs/fluentbit/jsonline-ha/compose.yml
index ffe557c61..3a9ccc9a9 100644
--- a/deployment/docker/victorialogs/fluentbit/jsonline-ha/compose.yml
+++ b/deployment/docker/victorialogs/fluentbit/jsonline-ha/compose.yml
@@ -1,5 +1,5 @@
 include:
   - path:
-      - ../compose.yml
+      - ../compose-base.yml
       - ../../compose-ha.yml
 name: fluentbit-jsonline-ha
diff --git a/deployment/docker/victorialogs/fluentbit/jsonline/compose.yml b/deployment/docker/victorialogs/fluentbit/jsonline/compose.yml
index 4edd0c18b..fcdecd21b 100644
--- a/deployment/docker/victorialogs/fluentbit/jsonline/compose.yml
+++ b/deployment/docker/victorialogs/fluentbit/jsonline/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: fluentbit-jsonline
diff --git a/deployment/docker/victorialogs/fluentbit/loki/compose.yml b/deployment/docker/victorialogs/fluentbit/loki/compose.yml
index 1627ba043..9cf140127 100644
--- a/deployment/docker/victorialogs/fluentbit/loki/compose.yml
+++ b/deployment/docker/victorialogs/fluentbit/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: fluentbit-loki
diff --git a/deployment/docker/victorialogs/fluentd/compose.yml b/deployment/docker/victorialogs/fluentd/compose-base.yml
similarity index 96%
rename from deployment/docker/victorialogs/fluentd/compose.yml
rename to deployment/docker/victorialogs/fluentd/compose-base.yml
index e189f506e..0d35bfd8e 100644
--- a/deployment/docker/victorialogs/fluentd/compose.yml
+++ b/deployment/docker/victorialogs/fluentd/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   fluentd:
     build: .
diff --git a/deployment/docker/victorialogs/fluentd/elasticsearch/compose.yml b/deployment/docker/victorialogs/fluentd/elasticsearch/compose.yml
index 9c65b063e..9ec3ada9d 100644
--- a/deployment/docker/victorialogs/fluentd/elasticsearch/compose.yml
+++ b/deployment/docker/victorialogs/fluentd/elasticsearch/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: fluentd-elasticsearch
diff --git a/deployment/docker/victorialogs/fluentd/jsonline/compose.yml b/deployment/docker/victorialogs/fluentd/jsonline/compose.yml
index efe3cb825..f99e29462 100644
--- a/deployment/docker/victorialogs/fluentd/jsonline/compose.yml
+++ b/deployment/docker/victorialogs/fluentd/jsonline/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: fluentd-jsonline
diff --git a/deployment/docker/victorialogs/fluentd/loki/compose.yml b/deployment/docker/victorialogs/fluentd/loki/compose.yml
index 1627ba043..9cf140127 100644
--- a/deployment/docker/victorialogs/fluentd/loki/compose.yml
+++ b/deployment/docker/victorialogs/fluentd/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: fluentbit-loki
diff --git a/deployment/docker/victorialogs/fluentd/syslog/compose.yml b/deployment/docker/victorialogs/fluentd/syslog/compose.yml
index e9e4e82da..d6b2c9656 100644
--- a/deployment/docker/victorialogs/fluentd/syslog/compose.yml
+++ b/deployment/docker/victorialogs/fluentd/syslog/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: fluentbit-syslog
diff --git a/deployment/docker/victorialogs/logstash/compose.yml b/deployment/docker/victorialogs/logstash/compose-base.yml
similarity index 94%
rename from deployment/docker/victorialogs/logstash/compose.yml
rename to deployment/docker/victorialogs/logstash/compose-base.yml
index 4263a392c..8f0ac156d 100644
--- a/deployment/docker/victorialogs/logstash/compose.yml
+++ b/deployment/docker/victorialogs/logstash/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   logstash:
     build:
diff --git a/deployment/docker/victorialogs/logstash/elasticsearch/compose.yml b/deployment/docker/victorialogs/logstash/elasticsearch/compose.yml
index 79399ecc2..2de18276b 100644
--- a/deployment/docker/victorialogs/logstash/elasticsearch/compose.yml
+++ b/deployment/docker/victorialogs/logstash/elasticsearch/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: logstash-elasticsearch
diff --git a/deployment/docker/victorialogs/logstash/jsonline-ha/compose.yml b/deployment/docker/victorialogs/logstash/jsonline-ha/compose.yml
index d63fa78c0..80a9dae0d 100644
--- a/deployment/docker/victorialogs/logstash/jsonline-ha/compose.yml
+++ b/deployment/docker/victorialogs/logstash/jsonline-ha/compose.yml
@@ -1,5 +1,5 @@
 include:
   - path:
-      - ../compose.yml
+      - ../compose-base.yml
       - ../../compose-ha.yml
 name: logstash-jsonline-ha
diff --git a/deployment/docker/victorialogs/logstash/jsonline/compose.yml b/deployment/docker/victorialogs/logstash/jsonline/compose.yml
index 11d4a0548..b0a1849b1 100644
--- a/deployment/docker/victorialogs/logstash/jsonline/compose.yml
+++ b/deployment/docker/victorialogs/logstash/jsonline/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: logstash-jsonline
diff --git a/deployment/docker/victorialogs/logstash/loki/compose.yml b/deployment/docker/victorialogs/logstash/loki/compose.yml
index 9e3249883..e312b61ac 100644
--- a/deployment/docker/victorialogs/logstash/loki/compose.yml
+++ b/deployment/docker/victorialogs/logstash/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: logstash-loki
diff --git a/deployment/docker/victorialogs/opentelemetry-collector/compose.yml b/deployment/docker/victorialogs/opentelemetry-collector/compose-base.yml
similarity index 94%
rename from deployment/docker/victorialogs/opentelemetry-collector/compose.yml
rename to deployment/docker/victorialogs/opentelemetry-collector/compose-base.yml
index 794f2382b..16e43eef8 100644
--- a/deployment/docker/victorialogs/opentelemetry-collector/compose.yml
+++ b/deployment/docker/victorialogs/opentelemetry-collector/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   collector:
     image: docker.io/otel/opentelemetry-collector-contrib:0.108.0
diff --git a/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch-ha/compose.yml b/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch-ha/compose.yml
index 6fc7eafd6..e8c3de276 100644
--- a/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch-ha/compose.yml
+++ b/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch-ha/compose.yml
@@ -1,5 +1,5 @@
 include:
  - path:
-     - ../compose.yml
+     - ../compose-base.yml
      - ../../compose-ha.yml
 name: collector-elasticsearch-ha
diff --git a/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch/compose.yml b/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch/compose.yml
index 6d8c4be2d..400e6ef82 100644
--- a/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch/compose.yml
+++ b/deployment/docker/victorialogs/opentelemetry-collector/elasticsearch/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: collector-elasticsearch
diff --git a/deployment/docker/victorialogs/opentelemetry-collector/loki/compose.yml b/deployment/docker/victorialogs/opentelemetry-collector/loki/compose.yml
index 865979e9b..51d822b84 100644
--- a/deployment/docker/victorialogs/opentelemetry-collector/loki/compose.yml
+++ b/deployment/docker/victorialogs/opentelemetry-collector/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: collector-loki
diff --git a/deployment/docker/victorialogs/opentelemetry-collector/otlp/compose.yml b/deployment/docker/victorialogs/opentelemetry-collector/otlp/compose.yml
index 9dcaed9be..2a2fde05e 100644
--- a/deployment/docker/victorialogs/opentelemetry-collector/otlp/compose.yml
+++ b/deployment/docker/victorialogs/opentelemetry-collector/otlp/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: collector-otlp
diff --git a/deployment/docker/victorialogs/opentelemetry-collector/syslog/compose.yml b/deployment/docker/victorialogs/opentelemetry-collector/syslog/compose.yml
index b87ea641e..f5e58d293 100644
--- a/deployment/docker/victorialogs/opentelemetry-collector/syslog/compose.yml
+++ b/deployment/docker/victorialogs/opentelemetry-collector/syslog/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: collector-syslog
diff --git a/deployment/docker/victorialogs/promtail/compose.yml b/deployment/docker/victorialogs/promtail/compose-base.yml
similarity index 93%
rename from deployment/docker/victorialogs/promtail/compose.yml
rename to deployment/docker/victorialogs/promtail/compose-base.yml
index 01d8e01d4..da25f0f1e 100644
--- a/deployment/docker/victorialogs/promtail/compose.yml
+++ b/deployment/docker/victorialogs/promtail/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   promtail:
     image: grafana/promtail:3.0.1
diff --git a/deployment/docker/victorialogs/promtail/loki/compose.yml b/deployment/docker/victorialogs/promtail/loki/compose.yml
index 5ee00fa08..a229023a9 100644
--- a/deployment/docker/victorialogs/promtail/loki/compose.yml
+++ b/deployment/docker/victorialogs/promtail/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: promtail-elasticsearch
diff --git a/deployment/docker/victorialogs/telegraf/compose.yml b/deployment/docker/victorialogs/telegraf/compose-base.yml
similarity index 95%
rename from deployment/docker/victorialogs/telegraf/compose.yml
rename to deployment/docker/victorialogs/telegraf/compose-base.yml
index 3132712ed..2851c274a 100644
--- a/deployment/docker/victorialogs/telegraf/compose.yml
+++ b/deployment/docker/victorialogs/telegraf/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   telegraf:
     image: bitnami/telegraf:1.31.3
diff --git a/deployment/docker/victorialogs/telegraf/elasticsearch/compose.yml b/deployment/docker/victorialogs/telegraf/elasticsearch/compose.yml
index e9285fa03..3c9d9d863 100644
--- a/deployment/docker/victorialogs/telegraf/elasticsearch/compose.yml
+++ b/deployment/docker/victorialogs/telegraf/elasticsearch/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: telegraf-elasticsearch
diff --git a/deployment/docker/victorialogs/telegraf/jsonline/compose.yml b/deployment/docker/victorialogs/telegraf/jsonline/compose.yml
index 68d7844a0..bb8bf05cc 100644
--- a/deployment/docker/victorialogs/telegraf/jsonline/compose.yml
+++ b/deployment/docker/victorialogs/telegraf/jsonline/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: telegraf-jsonline
diff --git a/deployment/docker/victorialogs/telegraf/loki/compose.yml b/deployment/docker/victorialogs/telegraf/loki/compose.yml
index 470a80a0a..1f99a2501 100644
--- a/deployment/docker/victorialogs/telegraf/loki/compose.yml
+++ b/deployment/docker/victorialogs/telegraf/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: telegraf-loki
diff --git a/deployment/docker/victorialogs/telegraf/syslog/compose.yml b/deployment/docker/victorialogs/telegraf/syslog/compose.yml
index 698adb2a9..2ee27c969 100644
--- a/deployment/docker/victorialogs/telegraf/syslog/compose.yml
+++ b/deployment/docker/victorialogs/telegraf/syslog/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: telegraf-syslog
diff --git a/deployment/docker/victorialogs/vector/compose.yml b/deployment/docker/victorialogs/vector/compose-base.yml
similarity index 95%
rename from deployment/docker/victorialogs/vector/compose.yml
rename to deployment/docker/victorialogs/vector/compose-base.yml
index 9c9c117d7..bc035bef7 100644
--- a/deployment/docker/victorialogs/vector/compose.yml
+++ b/deployment/docker/victorialogs/vector/compose-base.yml
@@ -1,5 +1,5 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 services:
   vector:
     image: docker.io/timberio/vector:0.40.0-distroless-static
diff --git a/deployment/docker/victorialogs/vector/elasticsearch/compose.yaml b/deployment/docker/victorialogs/vector/elasticsearch/compose.yaml
index bbb51e727..3e284ce3b 100644
--- a/deployment/docker/victorialogs/vector/elasticsearch/compose.yaml
+++ b/deployment/docker/victorialogs/vector/elasticsearch/compose.yaml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: vector-elasticsearch
diff --git a/deployment/docker/victorialogs/vector/jsonline-ha/compose.yml b/deployment/docker/victorialogs/vector/jsonline-ha/compose.yml
index 7d873452b..cb5d3dc41 100644
--- a/deployment/docker/victorialogs/vector/jsonline-ha/compose.yml
+++ b/deployment/docker/victorialogs/vector/jsonline-ha/compose.yml
@@ -1,5 +1,5 @@
 include:
   - path:
-      - ../compose.yml
+      - ../compose-base.yml
       - ../../compose-ha.yml
 name: vector-jsonline-ha
diff --git a/deployment/docker/victorialogs/vector/jsonline/compose.yml b/deployment/docker/victorialogs/vector/jsonline/compose.yml
index 10a44b140..ac6778e4f 100644
--- a/deployment/docker/victorialogs/vector/jsonline/compose.yml
+++ b/deployment/docker/victorialogs/vector/jsonline/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: vector-jsonline
diff --git a/deployment/docker/victorialogs/vector/loki/compose.yml b/deployment/docker/victorialogs/vector/loki/compose.yml
index 433c2bf9a..708e61097 100644
--- a/deployment/docker/victorialogs/vector/loki/compose.yml
+++ b/deployment/docker/victorialogs/vector/loki/compose.yml
@@ -1,3 +1,3 @@
 include:
- - ../compose.yml
+ - ../compose-base.yml
 name: vector-loki
diff --git a/deployment/docker/vm-datasource/docker-compose-cluster.yml b/deployment/docker/vm-datasource/docker-compose-cluster.yml
index c1b76ea4d..a09901a46 100644
--- a/deployment/docker/vm-datasource/docker-compose-cluster.yml
+++ b/deployment/docker/vm-datasource/docker-compose-cluster.yml
@@ -8,7 +8,7 @@ services:
       - 3000:3000
     volumes:
       - grafanadata:/var/lib/grafana
-      - ./provisioning/datasources/victoriametrics-datasource:/etc/grafana/provisioning/datasources
+      - ./provisioning/datasources/victoriametrics-datasource/cluster.yml:/etc/grafana/provisioning/datasources/cluster.yml
       - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
       - ./provisioning/plugins/:/var/lib/grafana/plugins
       - ./../../dashboards/vm/victoriametrics-cluster.json:/var/lib/grafana/dashboards/vm.json
diff --git a/deployment/docker/vm-datasource/docker-compose.yml b/deployment/docker/vm-datasource/docker-compose.yml
index 30b95d642..cb7f35054 100644
--- a/deployment/docker/vm-datasource/docker-compose.yml
+++ b/deployment/docker/vm-datasource/docker-compose.yml
@@ -8,7 +8,7 @@ services:
       - 3000:3000
     volumes:
       - grafanadata:/var/lib/grafana
-      - ./provisioning/datasources/victoriametrics-datasource:/etc/grafana/provisioning/datasources
+      - ./provisioning/datasources/victoriametrics-datasource/single.yml:/etc/grafana/provisioning/datasources/single.yml
       - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards
       - ./provisioning/plugins/:/var/lib/grafana/plugins
       - ./../../dashboards/vm/victoriametrics.json:/var/lib/grafana/dashboards/vm.json
diff --git a/docs/VictoriaLogs/CHANGELOG.md b/docs/VictoriaLogs/CHANGELOG.md
index 197bff6f8..5b0e97032 100644
--- a/docs/VictoriaLogs/CHANGELOG.md
+++ b/docs/VictoriaLogs/CHANGELOG.md
@@ -15,6 +15,10 @@ according to [these docs](https://docs.victoriametrics.com/victorialogs/quicksta
 
 ## tip
 
+* FEATURE: [data ingestion](https://docs.victoriametrics.com/victorialogs/data-ingestion/): accept Unix timestamps in seconds in the ingested logs.
+* FEATURE: [`sort` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#sort-pipe): allow using `order` alias instead of `sort`. For example, `_time:5s | order by (_time)` query works the same as `_time:5s | sort by (_time)`.
+* FEATURE: [`stats` pipe](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe): allow using multiple identical [stats functions](https://docs.victoriametrics.com/victorialogs/logsql/#stats-pipe-functions) with distinct [filters](https://docs.victoriametrics.com/victorialogs/logsql/#stats-with-additional-filters) and automatically generated result names. For example, `_time:5m | count(), count() if (error)` query works as expected now, e.g. it returns two results over the last 5 minutes: the total number of logs and the number of logs with `error` [word](https://docs.victoriametrics.com/victorialogs/logsql/#word). Previously this query couldn't be executed because the `if (...)` condition wasn't included in the automatically generate result name, so both results had the same name - `count(*)`.
+
 ## [v0.31.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v0.31.0-victorialogs)
 
 Released at 2024-09-27
diff --git a/docs/VictoriaLogs/LogsQL.md b/docs/VictoriaLogs/LogsQL.md
index 2249106bd..7d26a7f52 100644
--- a/docs/VictoriaLogs/LogsQL.md
+++ b/docs/VictoriaLogs/LogsQL.md
@@ -2110,6 +2110,12 @@ The `by` keyword can be skipped in `sort ...` pipe. For example, the following q
 _time:5m | sort (foo, bar) desc
 ```
 
+The `order` alias can be used instead of `sort`, so the following query is equivalent to the previous one:
+
+```logsql
+_time:5m | order by (foo, bar) desc
+```
+
 Sorting of big number of logs can consume a lot of CPU time and memory. Sometimes it is enough to return the first `N` entries with the biggest
 or the smallest values. This can be done by adding `limit N` to the end of `sort ...` pipe.
 Such a query consumes lower amounts of memory when sorting big number of logs, since it keeps in memory only `N` log entries.
diff --git a/docs/VictoriaLogs/data-ingestion/README.md b/docs/VictoriaLogs/data-ingestion/README.md
index a548a195a..d84cd7603 100644
--- a/docs/VictoriaLogs/data-ingestion/README.md
+++ b/docs/VictoriaLogs/data-ingestion/README.md
@@ -46,9 +46,14 @@ It is possible to push thousands of log lines in a single request to this API.
 
 If the [timestamp field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#time-field) is set to `"0"`,
 then the current timestamp at VictoriaLogs side is used per each ingested log line.
-Otherwise the timestamp field must be in the [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) or [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format.
-For example, `2023-06-20T15:32:10Z` or `2023-06-20 15:32:10.123456789+02:00`.
-If timezone information is missing (for example, `2023-06-20 15:32:10`), then the time is parsed in the local timezone of the host where VictoriaLogs runs.
+Otherwise the timestamp field must be in one of the following formats:
+
+- [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) or [RFC3339](https://www.rfc-editor.org/rfc/rfc3339).
+  For example, `2023-06-20T15:32:10Z` or `2023-06-20 15:32:10.123456789+02:00`.
+  If timezone information is missing (for example, `2023-06-20 15:32:10`),
+  then the time is parsed in the local timezone of the host where VictoriaLogs runs.
+
+- Unix timestamp in seconds or in milliseconds. For example, `1686026893` (seconds) or `1686026893735` (milliseconds).
 
 See [these docs](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model) for details on fields,
 which must be present in the ingested log messages.
@@ -96,9 +101,14 @@ It is possible to push unlimited number of log lines in a single request to this
 
 If the [timestamp field](https://docs.victoriametrics.com/victorialogs/keyconcepts/#time-field) is set to `"0"`,
 then the current timestamp at VictoriaLogs side is used per each ingested log line.
-Otherwise the timestamp field must be in the [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) or [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format.
-For example, `2023-06-20T15:32:10Z` or `2023-06-20 15:32:10.123456789+02:00`.
-If timezone information is missing (for example, `2023-06-20 15:32:10`), then the time is parsed in the local timezone of the host where VictoriaLogs runs.
+Otherwise the timestamp field must be in one of the following formats:
+
+- [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) or [RFC3339](https://www.rfc-editor.org/rfc/rfc3339).
+  For example, `2023-06-20T15:32:10Z` or `2023-06-20 15:32:10.123456789+02:00`.
+  If timezone information is missing (for example, `2023-06-20 15:32:10`),
+  then the time is parsed in the local timezone of the host where VictoriaLogs runs.
+
+- Unix timestamp in seconds or in milliseconds. For example, `1686026893` (seconds) or `1686026893735` (milliseconds).
 
 See [these docs](https://docs.victoriametrics.com/victorialogs/keyconcepts/#data-model) for details on fields,
 which must be present in the ingested log messages.
diff --git a/docs/VictoriaLogs/keyConcepts.md b/docs/VictoriaLogs/keyConcepts.md
index dd1e5f8d7..d1b38ba65 100644
--- a/docs/VictoriaLogs/keyConcepts.md
+++ b/docs/VictoriaLogs/keyConcepts.md
@@ -135,7 +135,15 @@ during [data ingestion](https://docs.victoriametrics.com/victorialogs/data-inges
 ### Time field
 
 The ingested [log entries](#data-model) may contain `_time` field with the timestamp of the ingested log entry.
-The timestamp must be in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) or [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+The timestamp field must be in one of the following formats:
+
+- [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) or [RFC3339](https://www.rfc-editor.org/rfc/rfc3339).
+  For example, `2023-06-20T15:32:10Z` or `2023-06-20 15:32:10.123456789+02:00`.
+  If timezone information is missing (for example, `2023-06-20 15:32:10`),
+  then the time is parsed in the local timezone of the host where VictoriaLogs runs.
+
+- Unix timestamp in seconds or in milliseconds. For example, `1686026893` (seconds) or `1686026893735` (milliseconds).
+
 For example, the following [log entry](#data-model) contains valid timestamp with millisecond precision in the `_time` field:
 
 ```json
@@ -152,7 +160,7 @@ field via `_time_field` query arg during [data ingestion](https://docs.victoriam
 For example, if timestamp is located in the `event.created` field, then specify `_time_field=event.created` query arg
 during [data ingestion](https://docs.victoriametrics.com/victorialogs/data-ingestion/).
 
-If `_time` field is missing, then the data ingestion time is used as log entry timestamp.
+If `_time` field is missing or if it equals `0`, then the data ingestion time is used as log entry timestamp.
 
 The `_time` field is used in [time filter](https://docs.victoriametrics.com/victorialogs/logsql/#time-filter) for quickly narrowing down
 the search to a particular time range.
diff --git a/docs/changelog/CHANGELOG.md b/docs/changelog/CHANGELOG.md
index a47759ea8..a36f4bb5d 100644
--- a/docs/changelog/CHANGELOG.md
+++ b/docs/changelog/CHANGELOG.md
@@ -31,7 +31,8 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
 * FEATURE: [dashboards](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/dashboards) for VM single-node, cluster, vmalert, vmagent, VictoriaLogs: add `Go scheduling latency` panel to show the 99th quantile of Go goroutines scheduling. This panel should help identifying insufficient CPU resources for the service. It is especially useful if CPU gets throttled, which now should be visible on this panel.
 * FEATURE: [alerts](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/deployment/docker/alerts-health.yml): add alerting rule to track the Go scheduling latency for goroutines. It should notify users if VM component doesn't have enough CPU to run or gets throttled.
 * FEATURE: [vmagent](https://docs.victoriametrics.com/vmagent/) and [Single-node VictoriaMetrics](https://docs.victoriametrics.com/): hide jobs that contain only healthy targets when `show_only_unhealthy` filter is enabled. Before, jobs without unhealthy targets were still displayed on the page. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3536).
-* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert): bump default values for sending data to `remoteWrite.url`: `remoteWrite.maxQueueSize` from `100_000` to `1_000_000`, `remoteWrite.maxBatchSize` from `1_000` to `10_000`, `remoteWrite.concurrency` from `1` to `4`. The new settings should improve remote write performance of vmalert with default settings.  
+* FEATURE: [vmalert](https://docs.victoriametrics.com/vmalert): bump default values for sending data to `remoteWrite.url`: `remoteWrite.maxQueueSize` from `100_000` to `1_000_000`, `remoteWrite.maxBatchSize` from `1_000` to `10_000`, `remoteWrite.concurrency` from `1` to `4`. The new settings should improve remote write performance of vmalert with default settings.
+* FEATURE: [vmbackupmanager](https://docs.victoriametrics.com/vmbackupmanager/): add API for creating/scheduling backups. See [documentation](https://docs.victoriametrics.com/vmbackupmanager/#api-methods)
 
 * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/) fix service discovery of Azure Virtual Machines for response contains `nextLink` in `Host:Port` format. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/6912).
 * BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent/): properly consume messages [from kafka](https://docs.victoriametrics.com/vmagent/#kafka-integration). Previously vmagent could skip some messages during start-up.
diff --git a/docs/operator/CHANGELOG.md b/docs/operator/CHANGELOG.md
index 1e76ac216..88a4fa1fe 100644
--- a/docs/operator/CHANGELOG.md
+++ b/docs/operator/CHANGELOG.md
@@ -11,6 +11,12 @@ aliases:
   - /operator/changelog/index.html
 ---
 
+## [v0.48.2](https://github.com/VictoriaMetrics/operator/releases/tag/v0.48.2) - 27 Sep 2024
+
+- [operator](https://docs.victoriametrics.com/operator/): properly expose `vm_app_version` metric tag with `version` and `short_version` build info. It was broken since v0.46.0 release.
+- [operator](https://docs.victoriametrics.com/operator/): changes default value for `controller.maxConcurrentReconciles` from `1` to `5`. It should improve reconcile performance for the most installations.
+- [operator](https://docs.victoriametrics.com/operator/): expose new runtime metrics `rest_client_request_duration_seconds`, `sched_latencies_seconds`. It allows to better debug operator reconcile latencies.
+
 ## [v0.48.1](https://github.com/VictoriaMetrics/operator/releases/tag/v0.48.1) - 26 Sep 2024
 
 - [vmalertmanager](https://docs.victoriametrics.com/operator/resources/vmalertmanager): properly build service, previously port by number instead of name was used. It produced `updating service` log messages.
diff --git a/docs/operator/vars.md b/docs/operator/vars.md
index 4e379301e..9cf6278c2 100644
--- a/docs/operator/vars.md
+++ b/docs/operator/vars.md
@@ -10,17 +10,17 @@ aliases:
   - /operator/vars/index.html
 ---
 <!-- this doc autogenerated - don't edit it manually -->
- updated at Wed Sep 18 22:37:27 UTC 2024
+ updated at Fri Sep 27 13:40:34 UTC 2024
 
 
 | variable name | variable default value | variable required | variable description |
 | --- | --- | --- | --- |
 | VM_USECUSTOMCONFIGRELOADER | false | false | enables custom config reloader for vmauth and vmagent, it should speed-up config reloading process. |
 | VM_CONTAINERREGISTRY | - | false | container registry name prefix, e.g. docker.io |
-| VM_CUSTOMCONFIGRELOADERIMAGE | victoriametrics/operator:config-reloader-v0.47.2 | false | - |
+| VM_CUSTOMCONFIGRELOADERIMAGE | victoriametrics/operator:config-reloader-v0.48.2 | false | - |
 | VM_PSPAUTOCREATEENABLED | false | false | - |
 | VM_VLOGSDEFAULT_IMAGE | victoriametrics/victoria-logs | false | - |
-| VM_VLOGSDEFAULT_VERSION | v0.28.0-victorialogs | false | - |
+| VM_VLOGSDEFAULT_VERSION | v0.31.0-victorialogs | false | - |
 | VM_VLOGSDEFAULT_CONFIGRELOADIMAGE | - | false | ignored |
 | VM_VLOGSDEFAULT_PORT | 9428 | false | - |
 | VM_VLOGSDEFAULT_USEDEFAULTRESOURCES | true | false | - |
@@ -136,4 +136,4 @@ aliases:
 | VM_PODWAITREADYINTERVALCHECK | 5s | false | Defines poll interval for pods ready check at statefulset rollout update |
 | VM_FORCERESYNCINTERVAL | 60s | false | configures force resync interval for VMAgent, VMAlert, VMAlertmanager and VMAuth. |
 | VM_ENABLESTRICTSECURITY | false | false | EnableStrictSecurity will add default `securityContext` to pods and containers created by operator Default PodSecurityContext include: 1. RunAsNonRoot: true 2. RunAsUser/RunAsGroup/FSGroup: 65534 '65534' refers to 'nobody' in all the used default images like alpine, busybox. If you're using customize image, please make sure '65534' is a valid uid in there or specify SecurityContext. 3. FSGroupChangePolicy: &onRootMismatch If KubeVersion>=1.20, use `FSGroupChangePolicy="onRootMismatch"` to skip the recursive permission change when the root of the volume already has the correct permissions 4. SeccompProfile:      type: RuntimeDefault Use `RuntimeDefault` seccomp profile by default, which is defined by the container runtime, instead of using the Unconfined (seccomp disabled) mode. Default container SecurityContext include: 1. AllowPrivilegeEscalation: false 2. ReadOnlyRootFilesystem: true 3. Capabilities:      drop:        - all turn off `EnableStrictSecurity` by default, see https://github.com/VictoriaMetrics/operator/issues/749 for details |
-[envconfig-sum]: 73a7775dae545fdb60f3dd0ca0e84d31
\ No newline at end of file
+[envconfig-sum]: 97c30e81298d2e6bde28647c913b9b88
\ No newline at end of file
diff --git a/docs/vmbackupmanager.md b/docs/vmbackupmanager.md
index f2f0a69d6..1e24fe1b5 100644
--- a/docs/vmbackupmanager.md
+++ b/docs/vmbackupmanager.md
@@ -202,19 +202,25 @@ For example:
 
 `vmbackupmanager` exposes the following API methods:
 
-* GET `/api/v1/backups` - returns list of backups in remote storage.
-  Example output:
+* POST `/api/v1/backups` - schedule/create the backup. Response examples:
+
+  success, status code - 201, body:
   ```json
-  [{"name":"daily/2023-04-07","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:07+00:00"},{"name":"hourly/2023-04-07:11","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:06+00:00"},{"name":"latest","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:04+00:00"},{"name":"monthly/2023-04","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:10+00:00"},{"name":"weekly/2023-14","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:09+00:00"}]
+      {}
   ```
-  > Note: `created_at` field is in RFC3339 format.
 
-* GET `/api/v1/backups/<BACKUP_NAME>` - returns backup info by name.
-  Example output:
+  failure, status code - 400, body:
   ```json
-  {"name":"daily/2023-04-07","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:07+00:00","locked":true}
+      {"error": "backups <name> is in progress"}
   ```
 
+* GET `/api/v1/backups` - returns list of backups in remote storage.
+  Response example:
+  ```json
+  [{"name":"daily/2023-04-07","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:07+00:00"},{"name":"hourly/2023-04-07:11","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:06+00:00"},{"name":"latest","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:04+00:00"},{"name":"monthly/2023-04","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:10+00:00"},{"name":"weekly/2023-14","size_bytes":318837,"size":"311.4ki","created_at":"2023-04-07T16:15:09+00:00"}]
+  ```
+  > Note: `created_at` field is in RFC3339 format.
+  
 * PUT `/api/v1/backups/<BACKUP_NAME>` - update "locked" attribute for backup by name.
   Example request body:
   ```json
diff --git a/lib/logstorage/pipe.go b/lib/logstorage/pipe.go
index 6279d98de..5b0bc8b46 100644
--- a/lib/logstorage/pipe.go
+++ b/lib/logstorage/pipe.go
@@ -213,7 +213,7 @@ func parsePipe(lex *lexer) (pipe, error) {
 			return nil, fmt.Errorf("cannot parse 'replace_regexp' pipe: %w", err)
 		}
 		return pr, nil
-	case lex.isKeyword("sort"):
+	case lex.isKeyword("sort"), lex.isKeyword("order"):
 		ps, err := parsePipeSort(lex)
 		if err != nil {
 			return nil, fmt.Errorf("cannot parse 'sort' pipe: %w", err)
@@ -309,7 +309,7 @@ var pipeNames = func() map[string]struct{} {
 		"rename", "mv",
 		"replace",
 		"replace_regexp",
-		"sort",
+		"sort", "order",
 		"stats",
 		"stream_context",
 		"top",
diff --git a/lib/logstorage/pipe_sort.go b/lib/logstorage/pipe_sort.go
index caebb08b6..f14b30c6f 100644
--- a/lib/logstorage/pipe_sort.go
+++ b/lib/logstorage/pipe_sort.go
@@ -748,8 +748,8 @@ func sortBlockLess(shardA *pipeSortProcessorShard, rowIdxA int, shardB *pipeSort
 }
 
 func parsePipeSort(lex *lexer) (*pipeSort, error) {
-	if !lex.isKeyword("sort") {
-		return nil, fmt.Errorf("expecting 'sort'; got %q", lex.token)
+	if !lex.isKeyword("sort") && !lex.isKeyword("order") {
+		return nil, fmt.Errorf("expecting 'sort' or 'order'; got %q", lex.token)
 	}
 	lex.nextToken()
 
diff --git a/lib/logstorage/pipe_stats.go b/lib/logstorage/pipe_stats.go
index 9d1906fd3..7946efd1d 100644
--- a/lib/logstorage/pipe_stats.go
+++ b/lib/logstorage/pipe_stats.go
@@ -577,6 +577,9 @@ func parsePipeStats(lex *lexer, needStatsKeyword bool) (*pipeStats, error) {
 		resultName := ""
 		if lex.isKeyword(",", "|", ")", "") {
 			resultName = sf.String()
+			if f.iff != nil {
+				resultName += " " + f.iff.String()
+			}
 		} else {
 			if lex.isKeyword("as") {
 				lex.nextToken()


Test patch:
diff --git a/app/vlinsert/elasticsearch/elasticsearch_test.go b/app/vlinsert/elasticsearch/elasticsearch_test.go
index ca88d2ccc..bfb1cd52e 100644
--- a/app/vlinsert/elasticsearch/elasticsearch_test.go
+++ b/app/vlinsert/elasticsearch/elasticsearch_test.go
@@ -78,15 +78,18 @@ func TestReadBulkRequest_Success(t *testing.T) {
 {"create":{"_index":"filebeat-8.8.0"}}
 {"@timestamp":"2023-06-06 04:48:12.735+01:00","message":"baz"}
 {"index":{"_index":"filebeat-8.8.0"}}
-{"message":"xyz","@timestamp":"2023-06-06T04:48:13.735Z","x":"y"}
+{"message":"xyz","@timestamp":"1686026893735","x":"y"}
+{"create":{"_index":"filebeat-8.8.0"}}
+{"message":"qwe rty","@timestamp":"1686026893"}
 `
 	timeField := "@timestamp"
 	msgField := "message"
-	rowsExpected := 3
-	timestampsExpected := []int64{1686026891735000000, 1686023292735000000, 1686026893735000000}
+	rowsExpected := 4
+	timestampsExpected := []int64{1686026891735000000, 1686023292735000000, 1686026893735000000, 1686026893000000000}
 	resultExpected := `{"@timestamp":"","log.offset":"71770","log.file.path":"/var/log/auth.log","_msg":"foobar"}
 {"@timestamp":"","_msg":"baz"}
-{"_msg":"xyz","@timestamp":"","x":"y"}`
+{"_msg":"xyz","@timestamp":"","x":"y"}
+{"_msg":"qwe rty","@timestamp":""}`
 	f(data, timeField, msgField, rowsExpected, timestampsExpected, resultExpected)
 }
 
diff --git a/app/vlinsert/insertutils/timestamp_test.go b/app/vlinsert/insertutils/timestamp_test.go
index a386f09fa..a7f935384 100644
--- a/app/vlinsert/insertutils/timestamp_test.go
+++ b/app/vlinsert/insertutils/timestamp_test.go
@@ -27,25 +27,41 @@ func TestExtractTimestampRFC3339NanoFromFields_Success(t *testing.T) {
 		}
 	}
 
+	// UTC time
 	f("time", []logstorage.Field{
 		{Name: "foo", Value: "bar"},
 		{Name: "time", Value: "2024-06-18T23:37:20Z"},
 	}, 1718753840000000000)
 
+	// Time with timezone
 	f("time", []logstorage.Field{
 		{Name: "foo", Value: "bar"},
 		{Name: "time", Value: "2024-06-18T23:37:20+08:00"},
 	}, 1718725040000000000)
 
+	// SQL datetime format
 	f("time", []logstorage.Field{
 		{Name: "foo", Value: "bar"},
-		{Name: "time", Value: "2024-06-18T23:37:20.123-05:30"},
+		{Name: "time", Value: "2024-06-18 23:37:20.123-05:30"},
 	}, 1718773640123000000)
 
+	// Time with nanosecond precision
 	f("time", []logstorage.Field{
 		{Name: "time", Value: "2024-06-18T23:37:20.123456789-05:30"},
 		{Name: "foo", Value: "bar"},
 	}, 1718773640123456789)
+
+	// Unix timestamp in milliseconds
+	f("time", []logstorage.Field{
+		{Name: "foo", Value: "bar"},
+		{Name: "time", Value: "1718773640123"},
+	}, 1718773640123000000)
+
+	// Unix timestamp in seconds
+	f("time", []logstorage.Field{
+		{Name: "foo", Value: "bar"},
+		{Name: "time", Value: "1718773640"},
+	}, 1718773640000000000)
 }
 
 func TestExtractTimestampRFC3339NanoFromFields_Error(t *testing.T) {
diff --git a/lib/logstorage/parser_test.go b/lib/logstorage/parser_test.go
index 84093adb7..359347704 100644
--- a/lib/logstorage/parser_test.go
+++ b/lib/logstorage/parser_test.go
@@ -1025,6 +1025,7 @@ func TestParseQuerySuccess(t *testing.T) {
 	f(`* | stats count('') foo`, `* | stats count(_msg) as foo`)
 	f(`* | stats count(foo) ''`, `* | stats count(foo) as _msg`)
 	f(`* | count()`, `* | stats count(*) as "count(*)"`)
+	f(`* | count(), count() if (foo)`, `* | stats count(*) as "count(*)", count(*) if (foo) as "count(*) if (foo)"`)
 
 	// stats pipe count_empty
 	f(`* | stats count_empty() x`, `* | stats count_empty(*) as x`)
@@ -1150,9 +1151,11 @@ func TestParseQuerySuccess(t *testing.T) {
 
 	// sort pipe
 	f(`* | sort`, `* | sort`)
+	f(`* | order`, `* | sort`)
 	f(`* | sort desc`, `* | sort desc`)
 	f(`* | sort by()`, `* | sort`)
 	f(`* | sort bY (foo)`, `* | sort by (foo)`)
+	f(`* | ORDer bY (foo)`, `* | sort by (foo)`)
 	f(`* | sORt bY (_time, _stream DEsc, host)`, `* | sort by (_time, _stream desc, host)`)
 	f(`* | sort bY (foo desc, bar,) desc`, `* | sort by (foo desc, bar) desc`)
 	f(`* | sort limit 10`, `* | sort limit 10`)
diff --git a/lib/logstorage/pipe_sort_test.go b/lib/logstorage/pipe_sort_test.go
index 671f4b0e7..0385a51c0 100644
--- a/lib/logstorage/pipe_sort_test.go
+++ b/lib/logstorage/pipe_sort_test.go
@@ -308,7 +308,7 @@ func TestPipeSort(t *testing.T) {
 	})
 
 	// Sort by multiple fields with offset and limit
-	f("sort by (a, b) desc offset 2 limit 100", [][]Field{
+	f("order by (a, b) desc offset 2 limit 100", [][]Field{
 		{
 			{"_msg", `abc`},
 			{"a", `2`},
@@ -360,5 +360,5 @@ func TestPipeSortUpdateNeededFields(t *testing.T) {
 
 	// needed fields intersect with src
 	f("sort by(s1,s2)", "s1,f1,f2", "", "s1,s2,f1,f2", "")
-	f("sort by(s1,s2) rank as x", "s1,f1,f2,x", "", "s1,s2,f1,f2", "")
+	f("order by(s1,s2) rank as x", "s1,f1,f2,x", "", "s1,s2,f1,f2", "")
 }