Class LogRecordIterator
- Aws\CloudTrail\LogRecordIterator implements OuterIterator
- Namespace: Aws\CloudTrail
- Located at CloudTrail/LogRecordIterator.php
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.
Methods Summary
- static forTrail ( Aws\S3\S3Client $s3Client, Aws\CloudTrail\CloudTrailClient $cloudTrailClient, array $options = [] )
- static forBucket ( Aws\S3\S3Client $s3Client, string $s3BucketName, array $options = [] )
- static forFile ( Aws\S3\S3Client $s3Client, string $s3BucketName, string $s3ObjectKey )
- __construct ( Aws\CloudTrail\LogFileReader $logFileReader, Iterator $logFileIterator )
- current ( )
- next ( )
- key ( )
- valid ( )
- rewind ( )
- getInnerIterator ( )
Methods Details
static
Aws\CloudTrail\LogRecordIterator
forTrail (
Aws\S3\S3Client
$s3Client,
Aws\CloudTrail\CloudTrailClient
$cloudTrailClient,
array
$options = []
)
Parameters
Aws\S3\S3Client |
$s3Client | |
Aws\CloudTrail\CloudTrailClient |
$cloudTrailClient | |
array | $options = [] |
Returns
Aws\CloudTrail\LogRecordIterator |
static
Aws\CloudTrail\LogRecordIterator
forBucket (
Aws\S3\S3Client
$s3Client,
string
$s3BucketName,
array
$options = []
)
Parameters
Aws\S3\S3Client |
$s3Client | |
string | $s3BucketName | |
array | $options = [] |
Returns
Aws\CloudTrail\LogRecordIterator |
static
Aws\CloudTrail\LogRecordIterator
forFile (
Aws\S3\S3Client
$s3Client,
string
$s3BucketName,
string
$s3ObjectKey
)
Parameters
Aws\S3\S3Client |
$s3Client | |
string | $s3BucketName | |
string | $s3ObjectKey |
Returns
Aws\CloudTrail\LogRecordIterator |
__construct (
Aws\CloudTrail\LogFileReader
$logFileReader,
Iterator
$logFileIterator
)
Parameters
Aws\CloudTrail\LogFileReader |
$logFileReader | |
Iterator | $logFileIterator |
current ( )
Implementation of
Iterator::current()
next ( )
Implementation of
Iterator::next()
key ( )
Implementation of
Iterator::key()
valid ( )
Implementation of
Iterator::valid()
rewind ( )
Implementation of
Iterator::rewind()
getInnerIterator ( )
Implementation of
OuterIterator::getInnerIterator()