Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Skip sending oversized data to ES #166

Closed
MinhNguyenDev opened this issue Apr 16, 2018 · 2 comments
Closed

Skip sending oversized data to ES #166

MinhNguyenDev opened this issue Apr 16, 2018 · 2 comments

Comments

@MinhNguyenDev
Copy link
Contributor

I had a same issue as #112, one line in the log file was too big and when the ElasticsearchLogShipper tried to send the data, it failed and kept retry over and over again, which could be costly if using AWS Elasticsearch. Could we make a change to skip the large size record ? It will fail anyway and make the whole log shipper stop working and no way to recover unless we delete the line manually.
Here is some sample code:

                        while (count < _batchPostingLimit && TryReadLine(current, ref nextLineBeginsAtOffset, out nextLine))

                        {
                            if (nextLine.Length > 1000000) // We can make this number configurable
                            {
                                SelfLog.WriteLine("Line is too long. Length {0}. Skip sending to ElasticSearch", nextLine.Length);
                                continue;
                            }
                            // Add payload
                            ++count;
                        }

Thanks,

@mivano
Copy link
Contributor

mivano commented Apr 21, 2018

Sounds good. Care for a PR? Make it configurable would be good with a default that does not check for this?

@mivano
Copy link
Contributor

mivano commented Dec 16, 2019

Merged, closing issue

@mivano mivano closed this as completed Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants