Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update awslogs.md #3319

Merged
merged 2 commits into from
Jun 26, 2017
Merged

Update awslogs.md #3319

merged 2 commits into from
Jun 26, 2017

Conversation

mixja
Copy link
Contributor

@mixja mixja commented May 18, 2017

Signed-off-by: Justin Menga justin.menga@gmail.com

Proposed changes

Add documentation for new AWS CloudWatch logs multiline pattern options

Unreleased project version

Docker Engine 17.06

Related issues

moby/moby#30891

@mdlinville
Copy link

@nathanleclaire @FrenchBen @friism PTAL

@mdlinville mdlinville added area/engine Issue affects Docker engine/daemon Tech Review: Needed labels May 23, 2017
Copy link

@nrdlngr nrdlngr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, and thanks for your contribution. Would you mind making the following suggested changes to your documentation?

@@ -77,6 +77,115 @@ $ docker run --log-driver=awslogs \
> **Note**:
> Your AWS IAM policy must include the `logs:CreateLogGroup` permission before you attempt to use `awslogs-create-group`.

### awslogs-multiline-pattern

The `awslogs-multiline-pattern` specifies a regular expression pattern for identifying the start of a log message. A log message is made of a line that matches the pattern and any following lines that don't match the pattern.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The awslogs-multiline-pattern specifies a regular expression pattern for identifying the beginning of a container log entry. Any following lines that do not match the pattern are considered to be part of the current log entry. The next line that matches the pattern begins a new log entry.

> **Note**:
> Multiline logging performs regular expression parsing and matching of all log messages, which may have a negative impact on logging performance.

For example, to process the following log stream where new log messages start with the pattern `INFO`:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, to process the following log stream where new log entries begin with the pattern INFO:

...
```

Which will generate the following CloudWatch log events:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration would generate the following CloudWatch log entries:

Which will generate the following CloudWatch log events:

```
# First event
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change "First event", "Second event", and "Third event" to use "entry" instead of event?


### awslogs-datetime-format

The `awslogs-datetime-format` specifies an [strftime expression pattern](http://strftime.org) for identifying the start of a log message. A log message is made of a line that matches the pattern and any following lines that don't match the pattern.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The awslogs-datetime-format specifies a strftime expression pattern for for identifying the beginning of a container log entry. Any following lines that do not match the pattern are considered to be part of the current log entry. The next line that matches the pattern begins a new log entry.

> **Note**:
> Multiline logging performs regular expression parsing and matching of all log messages, which may have a negative impact on logging performance.

For example, to process the following log stream where new log messages start with the following timestamps:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, to process the following log stream where new log entries begin with the following timestamps:

[May 01, 2017 19:01:32] Another message was logged
```

An strftime expression of `[%b %d, %Y %H:%M:%S]` can be used:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the strftime expression, [%b %d, %Y %H:%M:%S]:

...
```

Which will generate the following CloudWatch log events:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration would generate the following CloudWatch log entries:

Which will generate the following CloudWatch log events:

```
# First event
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change "First event", "Second event", and "Third event" to use "entry" instead of event?

[May 01, 2017 19:01:32] Another message was logged
```

The following strftime codes are supported:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following strftime codes are supported:

@mixja mixja force-pushed the awslogs_multiline_logging branch from 2f96537 to ff98880 Compare May 27, 2017 20:30
@mixja
Copy link
Contributor Author

mixja commented May 27, 2017

@nrdlngr - changes submitted as requested

@mdlinville
Copy link

@FrenchBen PTAL or nominate.

@FrenchBen
Copy link
Contributor

I think this is more of a review by @samuelkarp - if he's happy with it, I don't see any blockers

Mac; for example: `sudo ifconfig lo0 alias 10.200.10.1/24`, and make sure that
your service is listening on this address or `0.0.0.0` (ie not `127.0.0.1`).
Then containers can connect to this address.
The Mac has a changing IP address (or none if you have no network access). From
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unrelated change.

@@ -77,6 +77,115 @@ $ docker run --log-driver=awslogs \
> **Note**:
> Your AWS IAM policy must include the `logs:CreateLogGroup` permission before you attempt to use `awslogs-create-group`.

### awslogs-multiline-pattern

Copy link
Contributor

@samuelkarp samuelkarp May 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need {% include edge_only.md section="option" %} or did the feature make it into the 17.06.0 RC?

Copy link

@mdlinville mdlinville May 31, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still needs it even if so, because 17.06 is not released yet. The code is:

{% include edge_only.md section="option" %}

Or maybe "feature" instead of "option" if that fits better. The text is not arbitrary, but there are a few choices, see _inclues/edge_only.md for more info on how it works.

@mdlinville mdlinville force-pushed the awslogs_multiline_logging branch from 0ca55e2 to 09abadd Compare June 19, 2017 19:20
@mdlinville
Copy link

I interactive rebased and removed the unrelated commit.

@mdlinville
Copy link

This was already addressed in #3615

@mdlinville mdlinville closed this Jun 22, 2017
@samuelkarp
Copy link
Contributor

@mstanleyjones It looks like #3615 lost a lot of the content from this one. Is that intentional?

@mdlinville
Copy link

Not necessarily, no. I'll review it and see what we need to keep from here. I wasn't focused on this PR when I did the work on that other one.

@mdlinville mdlinville reopened this Jun 22, 2017
mixja added 2 commits June 23, 2017 15:58
Signed-off-by: Justin Menga <justin.menga@gmail.com>
Signed-off-by: Justin Menga <justin.menga@gmail.com>
@mdlinville mdlinville force-pushed the awslogs_multiline_logging branch from 09abadd to 637cb38 Compare June 23, 2017 23:01
@mdlinville
Copy link

I'm taking this over to get the important info in here ported over.

@mdlinville mdlinville merged commit b1d32c9 into docker:master Jun 26, 2017
INFO Another message was logged
```

You can use the strftime expression of `[%b %d, %Y %H:%M:%S]`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this line is misplaced. Did you mean to have it say "You can use the regular expression of ^INFO:"?

For example, to process the following log stream where new log messages start with the pattern `INFO`:

Consider the following log stream, where each log message should start with the
patther `INFO`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/patther/pattern/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Issue affects Docker engine/daemon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants