/* * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once #include #include #include #include #include #include #include #include "osquery/core/test_util.h" #include "osquery/logger/plugins/buffered.h" namespace osquery { DECLARE_uint64(aws_kinesis_period); class KinesisLogForwarder : public BufferedLogForwarder { private: static const size_t kKinesisMaxLogBytes; static const size_t kKinesisMaxRecords; public: KinesisLogForwarder() : BufferedLogForwarder("kinesis", std::chrono::seconds(FLAGS_aws_kinesis_period), kKinesisMaxRecords) {} Status setUp() override; protected: Status send(std::vector& log_data, const std::string& log_type) override; private: std::string shard_id_; std::shared_ptr client_{nullptr}; FRIEND_TEST(KinesisTests, test_send); }; class KinesisLoggerPlugin : public LoggerPlugin { public: KinesisLoggerPlugin() : LoggerPlugin() {} Status setUp() override; Status init(const std::string& name, const std::vector& log) override { return Status(1, "Does not support status logs"); } Status logString(const std::string& s) override; private: std::shared_ptr forwarder_{nullptr}; }; }