SDK for PHP 3.x

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.

Table of Contents

Interfaces

OuterIterator

Methods

__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

Methods

__construct()

public __construct(LogFileReader $logFileReader, Iterator $logFileIterator) : mixed
Parameters
$logFileReader : LogFileReader
$logFileIterator : Iterator

current()

Returns the current log record as an array.

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

forBucket()

public static forBucket(S3Client $s3Client, string $s3BucketName[, array<string|int, mixed> $options = [] ]) : LogRecordIterator
Parameters
$s3Client : S3Client
$s3BucketName : string
$options : array<string|int, mixed> = []
Return values
LogRecordIterator

getInnerIterator()

public getInnerIterator() : mixed

key()

public key() : mixed

next()

public next() : mixed

rewind()

public rewind() : mixed

valid()

public valid() : mixed
On this page