Skip to content

Commit abd6a9e

Browse files
committed
Add "limit_recently_modified" parameter
Changes: - Add feature which allows skipping logs older than some specific time range
1 parent a9881ac commit abd6a9e

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

helm-chart/splunk-connect-for-kubernetes/charts/splunk-kubernetes-logging/templates/configMap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ data:
114114
path {{ $logDef.from.file.path }}
115115
pos_file {{ $.Values.containers.path }}/splunk-fluentd-{{ $name }}.pos
116116
read_from_head true
117+
{{- if $logDef.limitRecentlyModified }}
118+
limit_recently_modified {{ $logDef.limitRecentlyModified }}
119+
{{- end }}
117120
path_key source
118121
{{- if $logDef.multiline }}
119122
multiline_flush_interval {{ $logDef.multiline.flushInterval | default "5s" }}

helm-chart/splunk-connect-for-kubernetes/charts/splunk-kubernetes-logging/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ charEncodingUtf8: false
172172
# firstline: "<regexp_to_detect_firstline_of_multiline>"
173173
# flushInterval 5
174174
# sourcetype: "<sourcetype_of_logs>"
175+
# limitRecentlyModified: <time_duration>
175176
# ```
176177
#
177178
# = <source> =
@@ -223,6 +224,17 @@ charEncodingUtf8: false
223224
# sourcetype of each kind of log can be defined using the `sourcetype` field.
224225
# If `sourcetype` is not defined, `name` will be used.
225226
#
227+
# = limitRecentlyModified =
228+
# Limits the watching files that the modification time is within the specified time period when using * in path.
229+
# - <INTEGER>s: seconds
230+
# - <INTEGER>m: minutes
231+
# - <INTEGER>h: hours
232+
# - <INTEGER>d: days
233+
# - Otherwise, the field is parsed as float, and that float is the number of seconds
234+
# Example, specifying `limitRecentlyModified: 24h` will parse only files with modification time within 24 hours.
235+
# Files modified earlier will be skipped.
236+
# If `limitRecentlyModified` is not defined, this option will be disabled.
237+
#
226238
# ---
227239
# Here we have some default timestampExtraction and multiline settings for kubernetes components.
228240
# So, usually you just need to redefine the source of those components if necessary.

helm-chart/splunk-connect-for-kubernetes/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ splunk-kubernetes-logging:
247247
# firstline: "<regexp_to_detect_firstline_of_multiline>"
248248
# flushInterval 5
249249
# sourcetype: "<sourcetype_of_logs>"
250+
# limitRecentlyModified: <time_duration>
250251
# ```
251252
#
252253
# = <source> =
@@ -298,6 +299,17 @@ splunk-kubernetes-logging:
298299
# sourcetype of each kind of log can be defined using the `sourcetype` field.
299300
# If `sourcetype` is not defined, `name` will be used.
300301
#
302+
# = limitRecentlyModified =
303+
# Limits the watching files that the modification time is within the specified time period when using * in path.
304+
# - <INTEGER>s: seconds
305+
# - <INTEGER>m: minutes
306+
# - <INTEGER>h: hours
307+
# - <INTEGER>d: days
308+
# - Otherwise, the field is parsed as float, and that float is the number of seconds
309+
# Example, specifying `limitRecentlyModified: 24h` will parse only files with modification time within 24 hours.
310+
# Files modified earlier will be skipped.
311+
# If `limitRecentlyModified` is not defined, this option will be disabled.
312+
#
301313
# ---
302314
# Here we have some default timestampExtraction and multiline settings for kubernetes components.
303315
# So, usually you just need to redefine the source of those components if necessary.

0 commit comments

Comments
 (0)