mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
Flush logs to ES daemon as Bro is shutting down.
This commit is contained in:
parent
a4df914ab7
commit
ca5eb5382a
1 changed files with 2 additions and 2 deletions
|
@ -51,12 +51,12 @@ bool ElasticSearch::DoInit(string path, int num_fields, const Field* const * fie
|
||||||
|
|
||||||
bool ElasticSearch::DoFlush()
|
bool ElasticSearch::DoFlush()
|
||||||
{
|
{
|
||||||
//TODO: Send flush command to ElasticSearch
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ElasticSearch::DoFinish()
|
bool ElasticSearch::DoFinish()
|
||||||
{
|
{
|
||||||
|
BatchIndex();
|
||||||
return WriterBackend::DoFinish();
|
return WriterBackend::DoFinish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ bool ElasticSearch::AddFieldValueToBuffer(Value* val, const Field* field)
|
||||||
{
|
{
|
||||||
char c = val->val.string_val->data()[i];
|
char c = val->val.string_val->data()[i];
|
||||||
// HTML entity encode special characters.
|
// HTML entity encode special characters.
|
||||||
if ( c < 32 || c > 126 || c == '\n' || c == '"' || c == '\'' || c == '\\' )
|
if ( c < 32 || c > 126 || c == '\n' || c == '"' || c == '\'' || c == '\\' || c == '&' )
|
||||||
{
|
{
|
||||||
buffer.AddRaw("&#", 2);
|
buffer.AddRaw("&#", 2);
|
||||||
buffer.Add((uint8_t) c);
|
buffer.Add((uint8_t) c);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue