Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mirror
sumologic-collector-chef-cookbook
Commits
d8fb1ef9
Unverified
Commit
d8fb1ef9
authored
Jun 26, 2018
by
Kierran McPherson
Committed by
GitHub
Jun 26, 2018
Browse files
Merge pull request #158 from funzie19/cuttoff
Added cutoffTimestamp and cutoffRelativeTime as optional properties.
parents
6d491036
bfac72ac
Changes
5
Hide whitespace changes
Inline
Side-by-side
.kitchen.yml
View file @
d8fb1ef9
...
...
@@ -87,6 +87,7 @@ suites:
-
recipe[source-resource::script_create]
-
recipe[source-resource::syslog_create]
-
recipe[source-resource::graphite_create]
-
recipe[source-resource::local_file_cutoff]
attributes
:
SUMO_ACCESS_ID
:
<%= ENV['SUMO_ACCESS_ID'] %>
SUMO_ACCESS_KEY
:
<%= ENV['SUMO_ACCESS_KEY'] %>
...
...
CHANGELOG.md
View file @
d8fb1ef9
...
...
@@ -5,6 +5,10 @@ This CHANGELOG (now) follows the format listed at [Keep A Changelog](http://keep
## [Unreleased]
## [1.3.1] - 2018-06-22
### Added
-
Added
`cutoffTimestamp`
and
`cutoffRelativeTime`
properties.
## [1.3.0] - 2018-04-19
### Added
-
using node run state added as a viable option to supply credentials
...
...
libraries/provider_source.rb
View file @
d8fb1ef9
...
...
@@ -57,6 +57,8 @@ class Chef
hash
[
'source'
][
'defaultDateFormat'
]
=
new_resource
.
default_date_format
unless
new_resource
.
default_date_format
.
nil?
hash
[
'source'
][
'filters'
]
=
new_resource
.
filters
unless
new_resource
.
filters
.
nil?
hash
[
'source'
][
'alive'
]
=
new_resource
.
alive
unless
new_resource
.
alive
.
nil?
hash
[
'source'
][
'cutoffTimestamp'
]
=
new_resource
.
cuttoff_timestamp
unless
new_resource
.
cuttoff_timestamp
.
nil?
hash
[
'source'
][
'cutoffRelativeTime'
]
=
new_resource
.
cuttoff_relative_time
unless
new_resource
.
cuttoff_relative_time
.
nil?
hash
end
...
...
libraries/resource_source.rb
View file @
d8fb1ef9
...
...
@@ -42,6 +42,8 @@ class Chef
attribute
:default_date_format
,
kind_of:
String
attribute
:filters
,
kind_of:
Array
attribute
:alive
,
kind_of:
[
TrueClass
,
FalseClass
]
attribute
:cuttoff_timestamp
,
kind_of:
String
attribute
:cuttoff_relative_time
,
kind_of:
String
end
end
end
test/fixtures/cookbooks/source-resource/recipes/local_file_cutoff.rb
0 → 100644
View file @
d8fb1ef9
# frozen_string_literal: true
sumo_source_local_file
'local_file_cuttoff_timestamp'
do
source_json_directory
node
[
'sumologic'
][
'sumo_json_path'
]
path_expression
'/tmp/example'
cuttoff_timestamp
"1529339004"
end
sumo_source_local_file
'local_file_cuttoff_relative_time'
do
source_json_directory
node
[
'sumologic'
][
'sumo_json_path'
]
path_expression
'/tmp/example'
cuttoff_relative_time
'-1d'
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment