-
Notifications
You must be signed in to change notification settings - Fork 228
Add Timestamps, Time Zones, Time Ranges, and Date Formats for OpenTelemetry Collector #4758
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
Closed
Closed
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3184e23
OTel Timestamps Date Formats docs added
JV0812 0236d92
minor content fix
JV0812 dfaf34f
added the timestamp link to the reuse file
JV0812 474fccb
Merge branch 'main' into add-otel-timestamp-docs
jpipkin1 af02513
Update docs/send-data/opentelemetry-collector/time-reference.md
kimsauce b8ff6c8
Merge branch 'main' into add-otel-timestamp-docs
kimsauce eb8d850
fixes
kimsauce 4a5faa9
Update docs/send-data/opentelemetry-collector/time-reference.md
kimsauce 67280cd
Update docs/send-data/opentelemetry-collector/time-reference.md
kimsauce e291641
Merge branch 'main' into add-otel-timestamp-docs
kimsauce d0c8a49
add placeholders
kimsauce d373c18
Merge branch 'main' into add-otel-timestamp-docs
kimsauce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| **Advance options** for log collection can be used as follows: | ||
| * **Timestamp Format**. By default, Sumo Logic will automatically detect the timestamp format of your logs. However, you can manually specify a timestamp format for a source by configuring the following: | ||
| - **Timestamp locator**. Use a [Go regular expression](https://github.com/google/re2/wiki/Syntax) to match the timestamp in your logs. Ensure the regular expression includes a named capture group called `timestamp_field`. | ||
| - **Layout**. Specify the exact layout of the timestamp to be parsed. For example, `- %Y-%m-%dT%H:%M:%S.%LZ`. To learn more about the formatting rules, refer to [this guide](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/internal/coreinternal/timeutils/internal/ctimefmt/ctimefmt.go#L68). | ||
| - **Layout**. Specify the exact layout of the timestamp to be parsed. For example, `- %Y-%m-%dT%H:%M:%S.%LZ`. To learn more about the formatting rules, refer to [this guide](/docs/send-data/opentelemetry-collector/time-reference/). | ||
| - **Location (Time zone)**. Define the geographic location (timezone) to use when parsing a timestamp that does not include a timezone. The available locations depend on the local IANA Time Zone database. For example, `America/New_York`. See more examples [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| id: time-reference | ||
| title: OTel Timestamp and Date Format Reference | ||
| description: Learn about timestamp formats recognized by the Sumo Logic OpenTelemetry (OTel) Collector and available configuration options. | ||
| keywords: | ||
| - time-stamp | ||
| - otel-collector | ||
| --- | ||
|
|
||
| import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
|
||
| :::info | ||
| This page specifically covers the timestamp formats recognized by the Sumo Logic OpenTelemetry (OTel) Collector. While Sumo Logic’s [general time reference documentation](/docs/send-data/reference-information/time-reference/) explains how timestamps are parsed and indexed across all data sources, this guide focuses on the formats automatically detected and parsed by the OTel collector for log data. | ||
kimsauce marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ::: | ||
|
|
||
| We support several options for timestamps. When collecting log data, the timestamp attached to messages is vital, both for the integrity of the data in your account, and for accurate query results. | ||
|
|
||
| Because of the importance of timestamps, Sumo Logic indexes the timestamp of each message, making sure that data relevant to a query’s time range is returned properly in search results, which allows you to reconstruct a correct event timeline. | ||
|
|
||
| ## Timestamps | ||
|
|
||
| The timestamp is the part of a log message that marks the time that an event occurred. During ingestion, we can detect the message timestamp, convert it to Unix epoch time (the number of milliseconds since midnight, January 1, 1970 UTC), and index it. The timestamp is parsed either using the default timestamp parsing settings, or a custom format that you specify. | ||
|
|
||
| ### OTel automated timestamp parsing | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per @echlebek , it would be useful to include another column that describes the name of the format, e.g., ISO8601 |
||
| | OTel Timestamp Format | Example | | ||
| |:---|:---| | ||
| | `%Y-%m-%d'T'%H:%M:%S*%f%z` | 2023-08-20'T'13:20:10*633+0000 | | ||
| | `%Y %b %d %H:%M:%S.%f %Z` | 2023 Mar 03 05:12:41.211 PDT | | ||
| | `%b %d %H:%M:%S %z %Y` | Jan 21 18:20:11 +0000 2023 | | ||
| | `%d/%b/%Y:%H:%M:%S %z` | 19/Apr/2023:06:36:15 -0700 | | ||
| | `%b %d, %Y %l:%M:%S %p` | Dec 2, 2023 2:39:58 AM | | ||
| | `%b %d %Y %H:%M:%S` | Jun 09 2023 15:28:14 | | ||
| | `%b %d %H:%M:%S %Y` | Apr 20 00:00:35 2010 | | ||
| | `%b %d %H:%M:%S %z` | Sep 28 19:00:00 +0000 | | ||
| | `%b %d %H:%M:%S` | Mar 16 08:12:04 | | ||
| | `%Y-%m-%dT%H:%M:%S%z` | 2023-10-14T22:11:20+0000 | | ||
| | `%Y-%m-%d %H:%M:%S %z` | 2023-08-19 12:17:55 -0400 | | ||
| | `%Y-%m-%d %H:%M:%S%z` | 2023-08-19 12:17:55-0400 | | ||
| | `%Y %b %d %H:%M:%S.%f*%Z` | 2023 Apr 13 22:08:13.211*PDT | | ||
| | `%Y %b %d %l:%M:%S` | 2023 Mar 10 1:44:20 | | ||
| | `%Y-%m-%d %H:%M:%S,%f%z` | 2023-03-10 14:30:12,655+0000 | | ||
| | `%Y-%m-%d %H:%M:%S` | 2023-02-27 15:35:20 | | ||
| | `%Y-%m-%d %H:%M:%S.%f%z` | 2023-03-12 13:11:34.222-0700 | | ||
| | `%Y-%m-%d'T'%H:%M:%S.%f` | 2023-07-22'T'16:28:55.444 | | ||
| | `%Y-%m-%d'T'%H:%M:%S` | 2023-09-08'T'03:13:10 | | ||
| | `%Y-%m-%d'T'%H:%M:%S'%z` | 2023-03-12'T'17:56:22'-0700' | | ||
| | `%Y-%m-%dT%H:%M:%S.%f%z` | 2023-11-22'T'10:10:15.455 | | ||
| | `%Y-%m-%d'T'%H:%M:%S` | 2023-02-11'T'18:31:44 | | ||
| | `%Y-%m-%d*%H:%M:%S:%f` | 2023-10-30*02:47:33:899 | | ||
| | `%Y-%m-%d*%H:%M:%S` | 2023-07-04*13:23:55 | | ||
| | `%y-%m-%d %H:%M:%S,%f %z` | 23-02-11 16:47:35,985 +0000 | | ||
| | `%y-%m-%d %H:%M:%S,%f` | 23-06-26 02:31:29,573 | | ||
| | `%y-%m-%d %H:%M:%S` | 23-04-19 12:00:17 | | ||
| | `%m/%d/%y %l:%M:%S` | 06/01/23 4:11:05 | | ||
| | `%m%d%y %H:%M:%S` | 220423 11:42:35 | | ||
| | `%Y%m%d %H:%M:%S.%f` | 20230423 11:42:35.173 | | ||
| | `%m/%d/%y*%H:%M:%S` | 08/10/23*13:33:56 | | ||
| | `%m/%d/%Y*%H:%M:%S` | 11/23/2023*05:13:11 | | ||
| | `%m/%d/%y %H:%M:%S %z` | 04/23/23 04:34:22 +0000 | | ||
| | `%m/%d/%Y %H:%M:%S %z` | 10/03/2023 07:29:46 -0700 | | ||
| | `%H:%M:%S` | 11:42:35 | | ||
| | `%H:%M:%S,%f` | 11:42:35,173 | | ||
| | `%d/%b/%Y:%H:%M:%S` | 23/Apr/2023:11:42:35 | | ||
| | `%d/%b%Y %H:%M:%S` | 23/Apr/2023 11:42:35 | | ||
| | `%d-%b-%Y %H:%M:%S` | 23-Apr-2023 11:42:35 | | ||
| | `%d-%b-%Y %H:%M:%S` | 23-Apr-2023 11:42:36 | | ||
| | `%d %b %Y %H:%M:%S` | 23 Apr 2023 11:42:35 | | ||
| | `%d %b %Y %H:%M:%S*%f` | 23 Apr 2023 10:32:35*311 | | ||
| | `%m%d_%H:%M:%S` | 0423_11:42:35 | | ||
| | `%m%d_%H:%M:%S.%f` | 0423_11:42:35.883 | | ||
| | `%q/%g/%Y %l:%M:%S %p:%f` | 8/5/2023 3:31:18 AM:234 | | ||
| | `%q/%d/%Y %I:%M:%S %p` | 9/28/2023 2:23:15 PM | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.