Skip to content

Commit afe8884

Browse files
authored
Added Timestamp in Logstash config
1 parent ca4d379 commit afe8884

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

manage-data/ingest/transform-enrich/ingest-lag.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ While we can't always resolve every situation, the approach described above usua
8484

8585
Regardless of the chosen architecture, it's a good practice to add a `remove` processor at the end of the pipeline to drop the `_tmp` field. The raw timestamps from the various processing steps are not needed, as the latency in seconds should be sufficient. For additional pipeline architectures, refer to the [Ingest Architectures](../ingest-reference-architectures.md) documentation.
8686

87+
## Logstash
88+
When Logstash is the mix we want to add a timestamp, this can only be done by using Ruby and the simplest form is this:
89+
```
90+
ruby {
91+
code => "event.set('@timestamp', Time.now());"
92+
}
93+
```
94+
8795
### Elastic Agent => Elasticsearch
8896

8997
We can use `@timestamp` and `event.ingested` and calculate the difference. This will give you the following document. The `event.ingestion.latency` is in seconds.

0 commit comments

Comments
 (0)