forked from opensearch-project/dashboards-observability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Liang <[email protected]>
- Loading branch information
Showing
3 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
server/adaptors/integrations/__data__/repository/aws_s3/assets/create_mv-1.0.0.sql
This file contains 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,34 @@ | ||
CREATE MATERIALIZED VIEW {table_name}_mview AS | ||
SELECT | ||
owner_id AS `aws.s3.bucket_owner`, | ||
bucket_name AS `aws.s3.bucket`, | ||
CONCAT(request_time, ' ', request_time_zone) AS `aws.s3.request_time`, | ||
remote_ip AS `aws.s3.remote_ip`, | ||
requester AS `aws.s3.requester`, | ||
request_id AS `aws.s3.request_id`, | ||
operation AS `aws.s3.operation`, | ||
key AS `aws.s3.key`, | ||
request_uri AS `aws.s3.request_uri`, | ||
http_status AS `aws.s3.http_status`, | ||
error_code AS `aws.s3.error_code`, | ||
bytes_sent AS `aws.s3.bytes_sent`, | ||
object_size AS `aws.s3.object_size`, | ||
CAST(total_time AS INTEGER) AS `aws.s3.total_time`, | ||
CAST(turn_around_time AS INTEGER) AS `aws.s3.turn_around_time`, | ||
referrer AS `aws.s3.referrer`, | ||
user_agent AS `aws.s3.user_agent`, | ||
version_id AS `aws.s3.version_id`, | ||
host_id AS `aws.s3.host_id`, | ||
signature_version AS `aws.s3.signature_version`, | ||
cipher_suite AS `aws.s3.cipher_suite`, | ||
authentication_type AS `aws.s3.authentication_type`, | ||
host_header AS `aws.s3.host_header`, | ||
tls_version AS `aws.s3.tls_version` | ||
FROM | ||
{table_name} | ||
WITH ( | ||
auto_refresh = 'true', | ||
checkpoint_location = '{s3_bucket_location}', | ||
watermark_delay = '1 Minute', | ||
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}' | ||
); |
32 changes: 32 additions & 0 deletions
32
server/adaptors/integrations/__data__/repository/aws_s3/assets/create_table-1.0.0.sql
This file contains 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,32 @@ | ||
CREATE EXTERNAL TABLE IF NOT EXISTS {table_name} ( | ||
owner_id STRING, | ||
bucket_name STRING, | ||
request_time STRING, | ||
request_time_zone STRING, | ||
remote_ip STRING, | ||
requester STRING, | ||
request_id STRING, | ||
operation STRING, | ||
key STRING, | ||
request_uri STRING, | ||
http_status STRING, | ||
error_code STRING, | ||
bytes_sent BIGINT, | ||
object_size BIGINT, | ||
total_time STRING, | ||
turn_around_time STRING, | ||
referrer STRING, | ||
user_agent STRING, | ||
version_id STRING, | ||
host_id STRING, | ||
signature_version STRING, | ||
cipher_suite STRING, | ||
authentication_type STRING, | ||
host_header STRING, | ||
tls_version STRING | ||
) | ||
USING csv | ||
OPTIONS ( | ||
sep=' ' | ||
) | ||
LOCATION '{s3_bucket_location}'; |
This file contains 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