AWS CloudWatch Logs Archive (not S3), how to use it - amazon-web-services

I am reading AWS CloudWatch Logs documentation here. They says
Archive log data – You can use CloudWatch Logs to store your log data in highly durable storage. The CloudWatch Logs agent makes it easy to quickly send both rotated and non-rotated log data off of a host and into the log service. You can then access the raw log data when you need it.
And in the pricing page, they have
Store (Archival) $0.03 per GB
And in the Pricing Calculator, they mention
Log Storage/Archival (Standard and Vended Logs)
Log volume archived is estimated to be 15% of Log volume ingested (due to compression). Storage/Archival costs are estimated assuming customer choses a retention period of one (1) month. Default retention setting is ‘never expire’.
Problem
I am trying to understand the behavior of this archive feature to decide if I need to move my log data to S3. but I cannot find any further details. I have tried exploring every button and link in CloudWatch Logs pages but cannot find a way to archive the data, I can only delete them or edit their retention rules.
So how does it work? The remark in the Pricing Calculator says it is estimated to be 15% of ingested volume, does this mean it always archive 15% of the log automatically? And why do they have to assume in the calculation taht the retention period is set to 1 month, does the archive feature behave differently otherwise?

The Archive log data feature refers to storing log data in CloudWatch Logs. You do not need to do anything additional to 'archive'. It is the regular storage you can see on console.
Considering only storage pricing, storing logs in S3 is cheaper. It varies depending on region but in average on S3 Standard is about $0.025 per GB vs $0.03 per GB on CloudWatch Logs Storage. And if you move the objects to other storage classes it becomes cheaper.
About:
Log volume archived is estimated to be 15% of Log volume ingested (due
to compression)
It refers to if 100GB of data are ingested on CloudWatch Logs, it reflects as only 15GB (15%) on Storage due to the special compressed format in which they stored this logs.

Related

AWS CloudWatch difference log data ingested and actual size of Log Groups

I am currently analysing my cloud watch bill. It says that I have ingested 1,826.520 GB of Logs via AmazonCloudWatch PutLogEvents this month.
However when I go and check out my 8 Log Groups they only add up to a total of roughly 163 GB and they all have a retention period of far over a month.
Any idea what I am missing here? Would have assumed the number of ingested data at least to be the same size as the sum size of all log groups? Happy to provide more information also.
Had this same question and reached out to AWS Support to clarification. They indicated that:
IncomingBytes is the raw, uncompressed bytes while the Stored Bytes
is compressed
Additionally, while investigating a cost spike shortly after it occurred with CloudWatch, we also saw that reported storage in CloudWatch Logs for the effected Log Group was dramatically less than what was reported in the PutLogEvents line item on them bill. AWS Support indicated that:
Stored Bytes/Stored GB do not update in real time. There is a delay of
at least 24 hours on average but it can vary some.

Where GKE logs stored in GCP?

I can see logs are present in Stack driver Logging. But want to know here it stored (in any container?) Can I apply rotation on it because I need only 3 months data. And where to check how much it cost of storing the logs.
Each and every project has _Default and _Required Logs buckets, and there is no cost involve.
Required
holds Admin Activity audit logs, System Event audit logs, and Access Transparency logs, and retains them for 400 days. You aren't charged for the logs stored in _Required, and the retention period of the logs stored here cannot be modified. You cannot delete this bucket.
Default
holds all other ingested logs in a Google Cloud project except for the logs held in the _Required bucket. Standard Cloud Logging pricing applies to these logs. Log entries held in the _Default bucket are retained for 30 days, unless you apply custom retention rules. You can't delete this bucket, but you can disable the _Default log sink that routes logs to this bucket.
To answer your question about GKE pods logs, they are stored in the _Default bucket. Until now, there is no cost associated to storing them, but NOTE storage costs will apply to all chargeable logs retained longer than the default retention periods at the rate of $.01 per GiB per month (or fraction thereof); as of March 31, 2021.
Here's the gcloud command for how to read your pod's logs from the GCS bucket:
gcloud logging read resource.type="k8s_pod"

Cloudwatch log store costing vs S3 costing

I have an ec2 instance which is running apache application.
I have to store my apache log somewhere. For this, I have used two approaches:
Cloudwatch Agent to push logs to cloudwatch
CronJob to push log file to s3
I have used both of the methods. Both methods suit fine for me. But, here I am little worried about the costing.
Which of these will have minimum cost?
S3 Pricing is basically is based upon three factors:
The amount of storage.
The amount of data transferred every month.
The number of requests made monthly.
The cost for data transfer between S3 and AWS resources within the same region is zero.
According to Cloudwatch pricing for logs :
All log types. There is no Data Transfer IN charge for any of CloudWatch.Data Transfer OUT from CloudWatch Logs is priced.
Pricing details for Cloudwatch logs:
Collect (Data Ingestion) :$0.50/GB
Store (Archival) :$0.03/GB
Analyze (Logs Insights queries) :$0.005/GB of data scanned
Refer CloudWatch pricing for more details.
Similarly, according to AWS, S3 pricing differs region wise.
e.g For N.Virginia :
S3 Standard Storage
First 50 TB / Month :$0.023 per GB
Next 450 TB / Month :$0.022 per GB
Over 500 TB / Month :$0.021 per GB
Refer S3 pricing for more details.
Hence, we can conclude that sending logs to S3 will be more cost effective than sending them to CloudWatch.
They both have similar storage costs, but CloudWatch Logs has an additional ingest charge.
Therefore, it would be lower cost to send straight to Amazon S3.
See: Amazon CloudWatch Pricing – Amazon Web Services (AWS)

Amazon Kinesis Firehose Buffering to S3

I'm attempting to price out a streaming data / analytic application deployed to AWS and looking at using Kinesis Firehose to dump the data into S3.
My question is, when pricing out the S3 costs for this, I need to figure out out how many PUT's I will need.
So, I know the Firehose buffers the data and then flushes out to S3, however I'm unclear on whether it will write a single "file" with all of the records accumulated up to that point or if it will write each record individually.
So, assuming I set the buffer size / interval to an optimal amount based on size of records, does the number of S3 PUT's still equal the number of records OR the number of flushes that the Firehose performs?
Having read a substantial amount of AWS documentation, I respectfully disagree with the assertion that S3 will not charge you.
You will be billed separately for charges associated with Amazon S3 and Amazon Redshift usage including storage and read/write requests. However, you will not be billed for data transfer charges for the data that Amazon Kinesis Firehose loads into Amazon S3 and Amazon Redshift. For further details, see Amazon S3 pricing and Amazon Redshift pricing. [emphasis mine]
https://aws.amazon.com/kinesis/firehose/pricing/
What they are saying you will not be charged is anything additional by Kinesis Firehose for the transfers, other than the $0.035/GB, but you'll pay for the interactions with your bucket. (Data inbound to a bucket is always free of actual per-gigabyte transfer charges).
In the final analysis, though, you appear to be in control of the rough number of PUT requests against your bucket, based on some tunable parameters:
Q: What is buffer size and buffer interval?
Amazon Kinesis Firehose buffers incoming streaming data to a certain size or for a certain period of time before delivering it to destinations. You can configure buffer size and buffer interval while creating your delivery stream. Buffer size is in MBs and ranges from 1MB to 128MB. Buffer interval is in seconds and ranges from 60 seconds to 900 seconds.
https://aws.amazon.com/kinesis/firehose/faqs/#creating-delivery-streams
Unless it is collecting and aggregating the records into large files, I don't see why there would be a point in the buffer size and buffer interval... however, without firing up the service and taking it for a spin, I can (unfortunately) only really speculate.
I don't believe you pay anything extra for the write operation to S3 from Firehose.
You will be billed separately for charges associated with Amazon S3
and Amazon Redshift usage including storage and read/write requests.
However, you will not be billed for data transfer charges for the data
that Amazon Kinesis Firehose loads into Amazon S3 and Amazon Redshift.
For further details, see Amazon S3 pricing and Amazon Redshift
pricing.
https://aws.amazon.com/kinesis/firehose/pricing/
the cost is one S3 PUT for any operation done by kinesis, not for a single object.
so one flush of firehose is one put:
https://docs.aws.amazon.com/whitepapers/latest/building-data-lakes/data-ingestion-methods.html
https://forums.aws.amazon.com/thread.jspa?threadID=219275&tstart=0

What AWS CloudWatch Logs are using for storage?

I started working with amazon CloudWatch Logs. The question is, are AWS using Glacier or S3 to store the logs? They are using Kinesis to process the logs using filters. Can anyone please tell the answer?
AWS is likely to use S3, not Glacier.
Glacier would make problems if you would want access older logs as to get data stored in Amazon Glaciers can take few hours and this is definitely not the reaction time one expects from CloudWatch log analysing solution.
Also the price set for storing 1 GB of ingested logs seems to be derived from 1 GB stored on AWS S3.
S3 price for one GB stored a month is 0.03 USD, and price for storing 1 GB of logs per month is also 0.03 USD.
On CloudWatch pricing page is a note:
*** Data archived by CloudWatch Logs includes 26 bytes of metadata per log event and is compressed using gzip level 6 compression. Archived
data charges are based on the sum of the metadata and compressed log
data size.
According to Henry Hahn (AWS) presentation on CloudWatch it is "3 cents per GB and we compress it," ... " so you get 3 cents per 10 GB".
This makes me believe, they store it on AWS S3.
They are probably using DynamoDB. S3 (and Glacier) would not be good for files that are appended to on a very frequent basis.