Documentation

LogRecordIterator
in package
implements OuterIterator

The `Aws\CloudTrail\LogRecordIterator` provides an easy way to iterate over log records from log files generated by AWS CloudTrail.

CloudTrail log files contain data about your AWS API calls and are stored in Amazon S3 at a predictable path based on a bucket name, a key prefix, an account ID, a region, and date information. The files are gzipped and contain structured data in JSON format. This class allows you to specify options via its factory methods, including a date range, and emits each log record from any log files that match the provided options.

A log record containing data about an AWS API call is yielded for each iteration on this object.

Interfaces, Classes and Traits

OuterIterator

Table of Contents

$logFileIterator  : Iterator
$logFileReader  : LogFileReader
$recordIndex  : int
$records  : array<string|int, mixed>
__construct()  : mixed
current()  : array<string|int, mixed>|false
Returns the current log record as an array.
forBucket()  : LogRecordIterator
forFile()  : LogRecordIterator
forTrail()  : LogRecordIterator
getInnerIterator()  : mixed
key()  : mixed
next()  : mixed
rewind()  : mixed
valid()  : mixed
loadRecordsFromCurrentLogFile()  : bool
Examines the current file in the `logFileIterator` and attempts to read it and load log records from it using the `logFileReader`. This method expects that items pulled from the iterator will take the form:

Properties

Methods

current()

Returns the current log record as an array.

public current() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|false

getInnerIterator()

public getInnerIterator() : mixed
Return values
mixed

loadRecordsFromCurrentLogFile()

Examines the current file in the `logFileIterator` and attempts to read it and load log records from it using the `logFileReader`. This method expects that items pulled from the iterator will take the form:

private loadRecordsFromCurrentLogFile() : bool

[ 'Bucket' => '...', 'Key' => '...', ]

Return values
bool

Returns true if records were loaded and false if no records were found

Search results