Skip to content

Commit

Permalink
change path
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-grabau committed Nov 19, 2024
1 parent 52cb5cb commit 7ac0ba7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ filter {
}
# lowercase field names
ruby {
path => "${LOGSTASH_HOME}\config\lower.rb"
path => "${LOGSTASH_HOME}/config/lower.rb"
tag_on_exception => "_lowecase_ruby_block"
}
# [file][mime_type]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,7 @@ filter {
}
# lowercase field names
ruby {
init => '@ignore = [ "path", "@timestamp", "@metadata", "host", "@version" ]'
code => '
def processArray(a)
newArray = []
a.each { |x|
newArray << processObject(x)
}
newArray
end
def processHash(h)
newHash = {}
h.each { |k, v|
newHash[k.downcase] = processObject(v)
}
newHash
end
def processObject(v)
if v.kind_of?(Array)
processArray(v)
elsif v.kind_of?(Hash)
processHash(v)
else
v
end
end
def filter(i_event)
i_event.to_hash.each { |k, v|
unless @ignore.include?(k)
i_event.remove(k)
i_event.set(k.downcase, processObject(v))
end
}
[i_event]
end
filter(event)
'
path => "${LOGSTASH_HOME}/config/lower.rb"
tag_on_exception => "_lowecase_ruby_block"
}
mutate {
Expand Down

0 comments on commit 7ac0ba7

Please sign in to comment.