Skip to content

Example for using FilterLogEventsAsync() #2863

Discussion options

You must be logged in to vote

Hello @spamulap12

You can try the below code.

class LogEventRetriever {
public:
    LogEventRetriever(const Aws::String& logGroupName, const Aws::String& filterPattern) : m_logGroupName(logGroupName), m_filterPattern(filterPattern) {}

    void retrieveLogEvents() {
        Aws::SDKOptions options;
        Aws::InitAPI(options);

        m_cwlClient = std::make_unique<Aws::CloudWatchLogs::CloudWatchLogsClient>();

        retrieveLogEvents();

        Aws::ShutdownAPI(options);
    }

private:
    void retrieveLogEvents() {
        Aws::CloudWatchLogs::Model::FilterLogEventsRequest request;
        request.SetLogGroupName(m_logGroupName);
        request.SetFilterPattern(m_filterPattern);…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jmklix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants