Forward Data from Sumo Logic to S3
You can forward log data from a partition or Scheduled View to an S3 bucket. Only new data is forwarded from a partition or Scheduled View once it is set to forward data.
To forward data to an S3 bucket:
- Configure an S3 forwarding destination.
- Forward data to the S3 forwarding destination from a partition or Schedule View.
After data forwarding is configured, you should start to see file objects posted within your configured bucket. If your Scheduled View conducts aggregation, which is a best practice, your aggregate fields are automatically appended to the forwarded objects.
Data forwarding is not currently supported for data assigned to the Infrequent Tier.
Prerequisites
- An administrator role on the partition where you want to set up forwarding.
- Follow the instructions on Grant Access to an AWS Product to grant Sumo Logic permission to send data to the destination S3 bucket.
- A partition or Scheduled View to push to Amazon S3.
Forwarding interval
Messages are buffered during data ingest for either approximately five minutes or until 100MB of data is received, whichever is first. Then the buffered data is written to a new CSV file and forwarded after compression.
The limits mentioned here are upper limits. Actual file size may vary depending on the ingestion volume in Scheduled Views or partitions of an account.
It takes approximately five minutes to propagate a new or changed S3 data forwarding rule or bucket across the Sumo Logic service. So, it is possible after you create or modify a rule, the first five minutes of data forwarded might not be written to S3.
File format of forwarded data
After you start forwarding data to S3, you should start to see file objects posted in your configured bucket. The log messages are accumulated and returned after being ingested by Sumo Logic. You can choose to forward only log data, log data and metadata, or log data with metadata and enriched fields, in either CSV or JSON format.
The log messages are saved in CSV or JSON files in compressed gzip files and named according to the convention you specified when you configured Sumo Logic to start data forwarding, as described in Forward data to an an S3 forwarding destination. The file naming convention for legacy data forwarding is described below in Legacy file naming format.
Messages are buffered during data ingest for either approximately five minutes or until 100MB of data is received, whichever is first. Then the buffered data is written to a new CSV or JSON file and forwarded.
These file objects will contain the messages received as well as the system metadata for the messages, including:
- messageId: The unique ID for the specific message within Sumo Logic.
- sourceName: Is returned blank.
- sourceHost: Is returned blank.
- sourceCategory: Is returned blank.
- messageTime: The parsed message time from the log message, as epoch.
- receiptTime: The time the service originally received the message, as epoch.
- sourceID: The unique ID of the Source configured to send the message to the service.
- collectorId: The unique ID of the Collector configured to send the message to the service.
- count: The message number from the specific log Source Name. These should be sequential for a specific Source file.
- format: The timestamp format used to parse the message time from the log message.
- view: The scheduled view or partition that the message is forwarded from.
- encoding: The encoding of the original file contents.
- message: The raw log message as read from the original Source.
- field: Aggregate fields are added based on your query.
Ordering of fields in forwarded file
- The order of the system fields is fixed, and the order is:
messageId, sourceName, sourceHost, sourceCategory, messageTime, receiptTime, sourceId, collectorId, count, format, view, encoding, message
. - Aggregate fields are represented in lowercase only.
- Aggregate fields are ordered based on ascending ASCII value.
- Aggregate fields are always present after the system or built-in fields.
Example
When forwarding data from Sumo Logic, the system will write structured logs that include the original message being forwarded, as well as additional metadata and quotation marks as seen in a structured JSON file.
Metadata fields
messageId,sourceName,sourceHost,sourceCategory,messageTime,receiptTime,sourceId,collectorId,count,format,view,encoding,message,aggregatefield1,aggregatefield2
Sample object
"-9223371513354977010","","","","1472590091453","1472590094034","101688020","100607825","979","plain:atp:o:0:l:29:p:yyyy-MM-dd HH:mm:ss,SSSZZZZ","JchenTest2","UTF8","2016-08-30 13:48:11,453 -0700 WARN [hostId=nite-cqsplitter-1] [module=cqsplitter] [localUserName=cqsplitter] [logger=cqsplitter.engine.CQsMultiMatchersManager] [thread=DTP-cqsplitter.receiver.consumer.v2.threadpool-6] MultiMatcher queue for customer 0000000000000131 is at capacity, adding element will block.","25","0000000000000131"
Legacy file naming format
The file naming convention for legacy data forwarding (prior to January 2017) is: <start_epoch>-<end_epoch>--<objectid>.csv.gz
Where:
start_epoch
is the epoch time representing the parsed message time of the first message contained within the file.end_epoch
is the epoch time representing the parsed message time of the last message contained within the file.objectid
is a unique ID for the file object, which is generated by Sumo Logic at creation time.
Configure an S3 data forwarding destination
Before you can forward data from a partition or Scheduled View, you must create a destination that indicates the S3 bucket where you want to send the forwarded data.
- Classic UI. In the main Sumo Logic menu, select Manage Data > Logs > Data Forwarding.
New UI. In the top menu select Configuration, and then under Logs select Data Forwarding. You can also click the Go To... menu at the top of the screen and select Data Forwarding. - Click + Destination to add a new destination.
- The Create New Destination popup appears.
- Destination Name. Enter a name to identify the destination.
- Bucket Name. Enter the exact name of the S3 bucket.
note
You can create only one destination with a particular bucket name. If you try to create a new destination with the bucket name of an existing destination, the new destination replaces the old one.
- Description. You can provide a meaningful description of the connection.
- Access Method. Select Role-based access or Key access based on the AWS authentication you are providing. Role-based access is preferred. This was completed in the prerequisite step Grant Access to an AWS Product.
- For Role-based access enter the Role ARN that was provided by AWS after creating the role.
- For Key access enter the Access Key ID and Secret Access Key. See Managing access keys for IAM users for details.
- S3 Region. Select the S3 region or keep the default value of Others. The S3 region must match the appropriate S3 bucket created in your Amazon account.
- Enable S3 server-side encryption. Select the check box if you want the forwarded data to be encrypted. For more information, see Using server-side encryption with Amazon S3 managed keys (SSE-S3) in AWS help.
- Active. Select this check box to enable data forwarding for the entire S3 bucket. To start forwarding data, you will also need to enable forwarding for the desired indexes, as described below.
- Click Save.
If Sumo Logic is able to verify the S3 credentials, the destination will be added to the list of destinations. If the destination is not added successfully, see Error and alert conditions for examples of errors that can occur.
Once the destination is created, you can start data forwarding for specific partitions or Scheduled Views as described in Forward data to an S3 forwarding destination below.
Forward data to an S3 forwarding destination
Once you configure an S3 forwarding destination that indicates the S3 bucket to receive the data, you can forward data to the destination from partitions and Scheduled Views.
- Depending on whether you want to forward data from a partition or a Scheduled View:
- Partition:
Classic UI. In the main Sumo Logic menu, select Manage Data > Logs > Partitions.
New UI. In the top menu select Configuration, and then under Logs select Partitions. You can also click the Go To... menu at the top of the screen and select Partitions. - Scheduled View:
Classic UI. In the main Sumo Logic menu, select Manage Data > Logs > Scheduled Views.
New UI. In the top menu select Configuration, and then under Logs select Scheduled Views. You can also click the Go To... menu at the top of the screen and select Scheduled Views.
- Partition:
- Select the partition or Scheduled View for which you want to enable data forwarding and click the Edit button. The edit dialog for the partition or Scheduled View displays. Following is the edit dialog for a partition.
tipIn addition to forwarding data from existing partitions and Scheduled Views, you can also enable data forwarding by selecting the Enable Data Forwarding check box when you first create a partition or create a Scheduled View.
- Click the Enable Data Forwarding checkbox. More options appear.
- Forwarding Destination. Choose one of the following:
- Existing Amazon S3 Destination. If you select this option, select the destination in the Amazon S3 Destination field below.
- New Amazon S3 Destination. Follow the instructions in Configure an S3 data forwarding destination above to create a new S3 destination.
- Amazon S3 Destination. If you chose Existing Amazon S3 Destination for the forwarding destination, select the destination here.
- Click Data Forwarding Configuration. Options appear for forwarding the data.
- Included Data. Select the kind of data to forward:
- Raw. Raw logs only.
- Raw + Metadata. Raw logs and the metadata fields assigned to log entries. We recommend this option because the forwarded data has the optimal balance of raw data and metadata that Sumo Logic adds (for example, to indicate source, source category, and so on).
- All (Raw + Metadata + Enriched Fields). Raw logs, the metadata fields assigned to log entries, and enriched fields from field extraction rules.
- Forwarded data type. Select the format for the forwarded data:
- Text. Plain text. (Available only if you choose Raw above.)
- CSV. Comma-separated values. (Available if you choose Raw + Metadata or All above.)
- JSON. Java Script Object Notation. (Available if you choose Raw + Metadata or All above.) Select JSON if you want to ensure that forwarded data can be re-ingested easily.
- File Prefix. Enter the path prefix to a directory in the S3 bucket. You can include any of the following variables:
{index}
will be replaced by the name of the partition or scheduled view.{day}
will be replaced by the day of the year in the yyyy-MM-dd format.{hour}
will be replaced by the hour of the day (0-23).{minute}
will be replaced by the minute of the hour.{second}
will be replaced by the second of the minute.{uuid}
will be replaced by a randomly generated universal unique identifier.
noteFor example, to place data in a directory named
SumoDataForwarding
you could specify the File Prefix as:SumoDataForwarding/{day}/{index}_{day}_{hour}_{minute}_{second}
If you leave this field blank, the default format is used:{index}_{day}_{hour}_{minute}_{second}
- Included Data. Select the kind of data to forward:
- Click Save at the top of the panel to save your changes and start forwarding data.
For information about how the data is forwarded, see Forwarding interval and File format of forwarded data.
Data forwarding example
Let's say you want to take data from Sumo Logic and run additional analysis on it in tools separate from Sumo Logic. You can forward the data from Sumo Logic to an S3 bucket where it is available for download and analysis by your tools.
Let's suppose you have an S3 bucket named amzn-s3-demo-bucket1
where you want to forward your Sumo Logic data. Do the following:
- Create a destination that points to the
amzn-s3-demo-bucket1
bucket. For example, name it Test destination. - Open the partition or Scheduled View whose data you want to forward data to the new destination.
- In the partition or Scheduled View, select Enable Data Forwarding, and fill out the fields that appear:
- In Forwarding Destination select Existing Amazon S3 Destination.
- In Amazon S3 Destination select the name of the destination you created earlier, for example, Test destination.
- Use the Data Forwarding Configuration section to specify whether to forward only log data, log data with metadata, or log data with metadata and enriched fields.
- Click Save on the partition or Scheduled View. The data will start forwarding to the S3 bucket specified in the destination.
Error and alert conditions
An error or alert condition can occur with an S3 data forwarding destination for the following reasons:
-
If Sumo Logic is not able to verify the S3 credentials when the destination is saved, an error message indicates that the credentials were rejected by Amazon. If this occurs, verify Access Key ID, Secret Access Key, and the bucket configuration, re-select the Active check box, and save again.
-
Errors and alerts that are generated after the destination has been successfully saved and started are shown on the Partitions page.
-
Hover over the icon to display the message.
In this example, Sumo Logic has disabled data forwarding due to errors in connecting to the S3 bucket. This occurs if the Amazon account or credentials change so that Sumo Logic is no longer able to authenticate to the bucket.