mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 13:08:20 +00:00
logging/sqlite: Recognize Log::default_logdir and place files there if set
This commit is contained in:
parent
aaa47a709c
commit
93584c7c7f
5 changed files with 78 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "zeek/logging/writers/sqlite/sqlite.bif.h"
|
||||
#include "zeek/threading/SerialTypes.h"
|
||||
#include "zeek/util.h"
|
||||
|
||||
using namespace std;
|
||||
using zeek::threading::Field;
|
||||
|
@ -128,8 +129,11 @@ bool SQLite::DoInit(const WriterInfo& info, int arg_num_fields, const Field* con
|
|||
num_fields = arg_num_fields;
|
||||
fields = arg_fields;
|
||||
|
||||
string fullpath(info.path);
|
||||
fullpath.append(".sqlite");
|
||||
auto fullpath = zeek::filesystem::path(
|
||||
zeek::id::find_const<StringVal>("Log::default_logdir")->ToStdString());
|
||||
|
||||
fullpath /= info.path;
|
||||
fullpath += ".sqlite";
|
||||
string tablename;
|
||||
|
||||
WriterInfo::config_map::const_iterator it = info.config.find("tablename");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue