fluent-plugin-elastic-log 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 605b6f2c68ea885b2e0a46bdb3a109ca31c5c73b589740b2951f90c61b5c91cf
|
4
|
+
data.tar.gz: 2b53da5b868725e625e7295740cfb01cdab7cafcbef724aabbf1dd999f2500ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bebb4b2ff28587c058e943ff135d1444d2f7a321bf1ea6219ce824451c3e2293e7a27337c7918cce34d20f4f3ac21c9aab3d59e2228779653e6d9cf3853508a0
|
7
|
+
data.tar.gz: 28cda27bd24301c8a529e28aac1710246b10cd76497217f7004e4c793d98bf55fa71e5131088fc81fed393832d19f8315d61482b31953fdaad08674853982d4b
|
data/.rubocop.yml
CHANGED
@@ -5,11 +5,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'fluent-plugin-elastic-log'
|
8
|
-
spec.version = '1.0.
|
8
|
+
spec.version = '1.0.2'
|
9
9
|
spec.authors = ['Thomas Tych']
|
10
10
|
spec.email = ['thomas.tych@gmail.com']
|
11
11
|
|
12
|
-
spec.summary =
|
12
|
+
spec.summary = 'fluentd plugins to process elastic logs'
|
13
13
|
spec.homepage = 'https://gitlab.com/ttych/fluent-plugin-elastic-log'
|
14
14
|
spec.license = 'Apache-2.0'
|
15
15
|
|
@@ -68,6 +68,18 @@ module Fluent
|
|
68
68
|
record[conf.request_type_key]
|
69
69
|
end
|
70
70
|
|
71
|
+
def record_request_path
|
72
|
+
record[conf.rest_request_path_key]
|
73
|
+
end
|
74
|
+
|
75
|
+
def trace_task_id
|
76
|
+
record[conf.trace_task_id_key]
|
77
|
+
end
|
78
|
+
|
79
|
+
def trace_task_parent_id
|
80
|
+
record[conf.trace_task_parent_id_key]
|
81
|
+
end
|
82
|
+
|
71
83
|
def timestamp
|
72
84
|
timestamp = Time.parse(record_timestamp)
|
73
85
|
|
@@ -83,11 +95,18 @@ module Fluent
|
|
83
95
|
nil
|
84
96
|
end
|
85
97
|
|
98
|
+
def query_type_from_request_path
|
99
|
+
return unless record_request_path
|
100
|
+
|
101
|
+
record_request_path.split('/').reject(&:empty?).first
|
102
|
+
end
|
103
|
+
|
86
104
|
def query_type
|
87
105
|
PRIVILEGE_MAP.each do |pattern, name|
|
88
106
|
return name if record_privilege.to_s.start_with?(pattern)
|
89
107
|
end
|
90
|
-
|
108
|
+
|
109
|
+
query_type_from_request_path || 'unknown'
|
91
110
|
end
|
92
111
|
|
93
112
|
def base
|
@@ -101,10 +120,10 @@ module Fluent
|
|
101
120
|
end
|
102
121
|
|
103
122
|
def indices
|
104
|
-
indices = record_r_indices || record_indices || [
|
123
|
+
indices = record_r_indices || record_indices || []
|
105
124
|
indices.inject(Set.new) do |acc, index|
|
106
125
|
acc << aggregate_index(index)
|
107
|
-
end
|
126
|
+
end.compact
|
108
127
|
end
|
109
128
|
|
110
129
|
def aggregate_index(index)
|
@@ -116,7 +135,10 @@ module Fluent
|
|
116
135
|
end
|
117
136
|
|
118
137
|
def generate_metrics
|
119
|
-
|
138
|
+
metrics = []
|
139
|
+
metrics += generate_user_metrics unless trace_task_parent_id
|
140
|
+
metrics += generate_index_metrics if !trace_task_id || trace_task_parent_id
|
141
|
+
metrics
|
120
142
|
end
|
121
143
|
|
122
144
|
def generate_user_metrics
|
@@ -48,6 +48,8 @@ module Fluent
|
|
48
48
|
DEFAULT_REQUEST_BODY = 'audit_request_body'
|
49
49
|
DEFAULT_TIMESTAMP_KEY = '@timestamp'
|
50
50
|
DEFAULT_PRIVILEGE_KEY = 'audit_request_privilege'
|
51
|
+
DEFAULT_TRACE_TASK_ID_KEY = 'audit_trace_task_id'
|
52
|
+
DEFAULT_TRACE_TASK_PARENT_ID_KEY = 'audit_trace_task_parent_id'
|
51
53
|
|
52
54
|
DEFAULT_AGGREGATE_INDEX_CLEAN_SUFFIX = [].freeze
|
53
55
|
DEFAULT_AGGREGATE_INTERVAL = nil
|
@@ -81,6 +83,10 @@ module Fluent
|
|
81
83
|
config_param :rest_request_path_key, :string, default: DEFAULT_REST_REQUEST_PATH
|
82
84
|
desc 'Request body key'
|
83
85
|
config_param :request_body_key, :string, default: DEFAULT_REQUEST_BODY
|
86
|
+
desc 'Trace task id key'
|
87
|
+
config_param :trace_task_id_key, :string, default: DEFAULT_TRACE_TASK_ID_KEY
|
88
|
+
desc 'Trace task parent id key'
|
89
|
+
config_param :trace_task_parent_id_key, :string, default: DEFAULT_TRACE_TASK_PARENT_ID_KEY
|
84
90
|
|
85
91
|
desc 'Timestamp format'
|
86
92
|
config_param :timestamp_format, :enum, list: %i[iso epochmillis epochmillis_str], default: :iso
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-elastic-log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Tych
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-25 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bump
|
@@ -269,5 +269,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
requirements: []
|
270
270
|
rubygems_version: 3.6.5
|
271
271
|
specification_version: 4
|
272
|
-
summary: fluentd plugins to process elastic logs
|
272
|
+
summary: fluentd plugins to process elastic logs
|
273
273
|
test_files: []
|