diff --git a/src/Interpreters/BackupLog.cpp b/src/Interpreters/BackupLog.cpp index 5e6c038ac5d..4953a2140ea 100644 --- a/src/Interpreters/BackupLog.cpp +++ b/src/Interpreters/BackupLog.cpp @@ -1,8 +1,10 @@ #include +#include #include #include #include +#include #include #include @@ -20,6 +22,7 @@ NamesAndTypesList BackupLogElement::getNamesAndTypes() { return { + {"hostname", std::make_shared(std::make_shared())}, {"event_date", std::make_shared()}, {"event_time_microseconds", std::make_shared(6)}, {"id", std::make_shared()}, @@ -41,6 +44,7 @@ NamesAndTypesList BackupLogElement::getNamesAndTypes() void BackupLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(DateLUT::instance().toDayNum(std::chrono::system_clock::to_time_t(event_time)).toUnderType()); columns[i++]->insert(event_time_usec); columns[i++]->insert(info.id); diff --git a/src/Interpreters/FilesystemCacheLog.cpp b/src/Interpreters/FilesystemCacheLog.cpp index b660db064d1..f8012925b8c 100644 --- a/src/Interpreters/FilesystemCacheLog.cpp +++ b/src/Interpreters/FilesystemCacheLog.cpp @@ -1,5 +1,7 @@ +#include #include #include +#include #include #include #include @@ -34,6 +36,7 @@ NamesAndTypesList FilesystemCacheLogElement::getNamesAndTypes() }; return { + {"hostname", std::make_shared(std::make_shared())}, {"event_date", std::make_shared()}, {"event_time", std::make_shared()}, {"query_id", std::make_shared()}, @@ -54,6 +57,7 @@ void FilesystemCacheLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(DateLUT::instance().toDayNum(event_time).toUnderType()); columns[i++]->insert(event_time); diff --git a/src/Interpreters/FilesystemReadPrefetchesLog.cpp b/src/Interpreters/FilesystemReadPrefetchesLog.cpp index d1cc61b94ba..3a26f069b5f 100644 --- a/src/Interpreters/FilesystemReadPrefetchesLog.cpp +++ b/src/Interpreters/FilesystemReadPrefetchesLog.cpp @@ -1,6 +1,8 @@ +#include #include #include #include +#include #include #include #include @@ -12,6 +14,7 @@ namespace DB NamesAndTypesList FilesystemReadPrefetchesLogElement::getNamesAndTypes() { return { + {"hostname", std::make_shared(std::make_shared())}, {"event_date", std::make_shared()}, {"event_time", std::make_shared()}, {"query_id", std::make_shared()}, @@ -33,6 +36,7 @@ void FilesystemReadPrefetchesLogElement::appendToBlock(MutableColumns & columns) { size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(DateLUT::instance().toDayNum(event_time).toUnderType()); columns[i++]->insert(event_time); columns[i++]->insert(query_id); diff --git a/src/Interpreters/OpenTelemetrySpanLog.cpp b/src/Interpreters/OpenTelemetrySpanLog.cpp index 610330b8559..40aaa63dd6e 100644 --- a/src/Interpreters/OpenTelemetrySpanLog.cpp +++ b/src/Interpreters/OpenTelemetrySpanLog.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -30,6 +31,7 @@ NamesAndTypesList OpenTelemetrySpanLogElement::getNamesAndTypes() auto low_cardinality_string = std::make_shared(std::make_shared()); return { + {"hostname", low_cardinality_string}, {"trace_id", std::make_shared()}, {"span_id", std::make_shared()}, {"parent_span_id", std::make_shared()}, @@ -67,6 +69,7 @@ void OpenTelemetrySpanLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(trace_id); columns[i++]->insert(span_id); columns[i++]->insert(parent_span_id); diff --git a/src/Interpreters/ProcessorsProfileLog.cpp b/src/Interpreters/ProcessorsProfileLog.cpp index 14159ad3438..68b5d63e613 100644 --- a/src/Interpreters/ProcessorsProfileLog.cpp +++ b/src/Interpreters/ProcessorsProfileLog.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -20,6 +21,7 @@ NamesAndTypesList ProcessorProfileLogElement::getNamesAndTypes() { return { + {"hostname", std::make_shared(std::make_shared())}, {"event_date", std::make_shared()}, {"event_time", std::make_shared()}, {"event_time_microseconds", std::make_shared(6)}, @@ -46,6 +48,7 @@ void ProcessorProfileLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(DateLUT::instance().toDayNum(event_time).toUnderType()); columns[i++]->insert(event_time); columns[i++]->insert(event_time_microseconds); diff --git a/src/Interpreters/S3QueueLog.cpp b/src/Interpreters/S3QueueLog.cpp index 4e43aae6b0d..fdf74b2b926 100644 --- a/src/Interpreters/S3QueueLog.cpp +++ b/src/Interpreters/S3QueueLog.cpp @@ -1,5 +1,7 @@ +#include #include #include +#include #include #include #include @@ -21,6 +23,7 @@ NamesAndTypesList S3QueueLogElement::getNamesAndTypes() {"Failed", static_cast(S3QueueLogElement::S3QueueStatus::Failed)}, }); return { + {"hostname", std::make_shared(std::make_shared())}, {"event_date", std::make_shared()}, {"event_time", std::make_shared()}, {"table_uuid", std::make_shared()}, @@ -37,6 +40,7 @@ NamesAndTypesList S3QueueLogElement::getNamesAndTypes() void S3QueueLogElement::appendToBlock(MutableColumns & columns) const { size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(DateLUT::instance().toDayNum(event_time).toUnderType()); columns[i++]->insert(event_time); columns[i++]->insert(table_uuid); diff --git a/src/Interpreters/SessionLog.cpp b/src/Interpreters/SessionLog.cpp index 2fc5c5b982b..61750b5acca 100644 --- a/src/Interpreters/SessionLog.cpp +++ b/src/Interpreters/SessionLog.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -120,6 +121,7 @@ NamesAndTypesList SessionLogElement::getNamesAndTypes() return { + {"hostname", lc_string_datatype}, {"type", std::move(event_type)}, {"auth_id", std::make_shared()}, {"session_id", std::make_shared()}, @@ -156,6 +158,7 @@ void SessionLogElement::appendToBlock(MutableColumns & columns) const size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(type); columns[i++]->insert(auth_id); columns[i++]->insert(session_id); diff --git a/src/Interpreters/TransactionsInfoLog.cpp b/src/Interpreters/TransactionsInfoLog.cpp index 90f5022a444..18a8b099ba4 100644 --- a/src/Interpreters/TransactionsInfoLog.cpp +++ b/src/Interpreters/TransactionsInfoLog.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -8,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +34,7 @@ NamesAndTypesList TransactionsInfoLogElement::getNamesAndTypes() return { + {"hostname", std::make_shared(std::make_shared())}, {"type", std::move(type_enum)}, {"event_date", std::make_shared()}, {"event_time", std::make_shared(6)}, @@ -69,6 +72,7 @@ void TransactionsInfoLogElement::appendToBlock(MutableColumns & columns) const assert(type != UNKNOWN); size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(type); auto event_time_seconds = event_time / 1000000; columns[i++]->insert(DateLUT::instance().toDayNum(event_time_seconds).toUnderType()); diff --git a/src/Interpreters/ZooKeeperLog.cpp b/src/Interpreters/ZooKeeperLog.cpp index 5b25ff41d6b..8369b4fffd2 100644 --- a/src/Interpreters/ZooKeeperLog.cpp +++ b/src/Interpreters/ZooKeeperLog.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -5,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -118,6 +120,7 @@ NamesAndTypesList ZooKeeperLogElement::getNamesAndTypes() return { + {"hostname", std::make_shared(std::make_shared())}, {"type", std::move(type_enum)}, {"event_date", std::make_shared()}, {"event_time", std::make_shared(6)}, @@ -168,6 +171,7 @@ void ZooKeeperLogElement::appendToBlock(MutableColumns & columns) const assert(type != UNKNOWN); size_t i = 0; + columns[i++]->insert(getFQDNOrHostName()); columns[i++]->insert(type); auto event_time_seconds = event_time / 1000000; columns[i++]->insert(DateLUT::instance().toDayNum(event_time_seconds).toUnderType());