Comments (7)
Due to our monotonic bookmarking in the durable shipper, as noted in the linked issue, it is difficult to know what to do when a single document in the middle of a bulk index
fails.
We can use the _id
field to stop us inserting duplicates here. If we generate a unique _id
when we save the files to the durable file, we can use this in each of our index
commands to allow ElasticSearch to either: reject duplicate _id
s that are already indexed using the create
operation or "upsert" (updating any existing document with the same _id
or create if nonexistent) using the index
operation. Only if the entire batch passes do we bookmark and continue. Perhaps we could retry a batch a certain number of times before bookmarking it anyway?
from serilog-sinks-elasticsearch.
What's the status on this issue ?
@konste stated on serilog/serilog#599 that a PR was made with NEST 2.0, but I can't seem te find it.
@mivano was working on a feature branch https://github.com/serilog/serilog-sinks-elasticsearch/tree/handlefailures , but this was never finished or merged to dev.
It would be nice to just parse the bulk response and log any failures. Retries are less important to me, as most failures will most likely be the result of malformed requests.
Are there still any plans to continute this work, or will it be discarded?
from serilog-sinks-elasticsearch.
This is custom modification of the official Serilog ES Sink, done for two reasons:
- To be able to apply modified ES Json Formatter;
- To modify EmitBatch method so that it records possible server side failures to internal log;
from serilog-sinks-elasticsearch.
Thanks @konste . I'm using the DurableElasticsearchSink though, the parsing of the response happens in the ElastsearchLogShipper. Which means I'ld have to copy a lot more code. I'll first try fixing the problem in my fork. I see you are using Nest to parse the response to BulkResponse. Something I already tried and which wasn't 100% correct. So I'll look into that. Problem is the overlap with @mivano 's work, of which I wonder why it was discontinued.
from serilog-sinks-elasticsearch.
PR : #110
from serilog-sinks-elasticsearch.
It just lost interest but we had indeed some ideas how to act on failures. So at least check the result from ES by parsing the return data. If there is a failure in there (can even be one of the 50 in the batch) we allowed to either send it to selflog or another sink.
If interest is there, I can port it to the current version.
from serilog-sinks-elasticsearch.
Since v5.5 there have been some improvements in this area.
from serilog-sinks-elasticsearch.
Related Issues (20)
- v9.0.0 fails template creation with ES v7 with ElasticsearchClientException HOT 3
- v. 9.0.0 - ElasticsearchClientException: Could not authenticate with the specified node HOT 1
- Add autogenerated template IndexAliases configuration properties HOT 2
- Possible clock issue?
- The ES7 template registration throw an exception HOT 1
- New version 9.0.3 doesn't work with Logstash HOT 1
- The client noticed that the server is not a supported distribution of Elasticsearch. HOT 1
- 9.0.3 did not bring in changes from 9.0.2 HOT 2
- Unable to connect and write logs to Elasticsearch v8.8.1 HOT 3
- Unable to upload logs to Elastic Search Cloud HOT 1
- Unable to send logs to OpenTelemetry backend (using Serilog in .Net framework 4.8)
- How can i add a custom Id to es with Serilog.Sinks.Elasticsearch
- Support the new TraceId and SpanId in Serilog HOT 1
- Add Support for OpenSearch.
- How do I update Dotnet Serilog Logging Config to Deal with new Elastic 8 security (https, username, password, tls cert)? HOT 1
- Enable configuration of IndexDecider also from a config file
- serilog.sinks.elasticsearch is missing NuGet package README file
- Not Load Type
- Serilog.Sinks.Elasticsearch 10.0.0 don't works with Serilog.Sinks.MariaDB 1.0.1
- Future of this sink HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serilog-sinks-elasticsearch.