Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.0.3
- Adds ability to set a file header

## 2.0.2
- Fixes an issue when tags were defined #39
## 2.0.0
Expand Down
14 changes: 14 additions & 0 deletions lib/logstash/outputs/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
#
config :tags, :validate => :array, :default => []

# If set, this will be the first row of every file pushed to S3
#
# Ensure that you are setting this to the actual number of columns in your data. It is not dynamic
# and will not help you out if the underlying schema changes.
#
# Recommend to use wtih this a filter that produces an explicit set of fields no matter the input
# event
config :header_row, :validate => :string, :default => ""

# Exposed attributes for testing purpose.
attr_accessor :tempfile
attr_reader :page_counter
Expand Down Expand Up @@ -180,6 +189,11 @@ def create_temporary_file
end

@tempfile = File.open(filename, "a")

# header row processing
if @headerrow.eql? ""
@tempfile.syswrite(@headerrow)
end
end
end

Expand Down