Skip to content

Commit

Permalink
Merge pull request #89 from YANG-DB/nginx-integration-flint-s3
Browse files Browse the repository at this point in the history
add nginx flint-s3 based integration support
  • Loading branch information
YANG-DB authored Oct 31, 2023
2 parents 63f40aa + d2d6309 commit 4691ec8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE MATERIALIZED VIEW {table_name}_mview AS
SELECT
to_timestamp(trim(BOTH '[]' FROM concat(time_local_1, ' ', time_local_2)), 'dd/MMM/yyyy:HH:mm:ss Z') AS `@timestamp`,
split_part (request, ' ', 1) as `http.request.method`,
split_part (request, ' ', 2) as `http.url`,
split_part (request, ' ', 3) as `http.flavor`,
status AS `http.response.status_code`,
body_bytes_sent AS `http.response.bytes`,
'nginx.access' AS `event.domain`
FROM {table_name}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE EXTERNAL TABLE {table_name} (
remote_addr STRING,
empty_col STRING,
remote_user STRING,
time_local_1 STRING,
time_local_2 STRING,
request STRING,
status INT,
body_bytes_sent INT,
http_referer STRING,
http_user_agent STRING,
gzip_ratio STRING
) USING csv
LOCATION '{s3_bucket_location}'
OPTIONS (
sep=' ',
nullValue='-'
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REFRESH MATERIALIZED VIEW {table_name}_mview;
19 changes: 18 additions & 1 deletion integrations/observability/nginx/nginx-1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"type-alias": "logs-nginx",
"type": "logs",
"labels": ["log", "http", "communication"],
"labels": ["log", "http", "communication","Flint S3"],
"author": "OpenSearch",
"sourceUrl": "https://github.com/opensearch-project/opensearch-catalog/integrations/observability/nginx/info",
"statics": {
Expand Down Expand Up @@ -36,6 +36,23 @@
}
],
"assets": {
"tables": [
{
"name": "create_table_nginx",
"version": "1.0.0",
"language": "sql"
},
{
"name": "create_mv_nginx",
"version": "1.0.0",
"language": "sql"
},
{
"name": "refresh_mv_nginx",
"version": "1.0.0",
"language": "sql"
}
],
"savedObjects": {
"name": "nginx",
"version": "1.0.0"
Expand Down

0 comments on commit 4691ec8

Please sign in to comment.