I'm getting this error while upgrading logstash 5.6 to 6.8. It would be very kind of you if you could suggest here something?
Please find the snippet of the error-
[2022-02-09T17:39:49,294][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<TypeError: illegal access on 'getThreadCount': class org.jruby.javasupport.JavaMethod cannot access class sun.management.ThreadImpl (in module java.management) because module java.management does not export sun.management to unnamed module @e320068>, :backtrace=>["D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/instrument/periodic_poller/jvm.rb:82:in `collect_threads_metrics'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/instrument/periodic_poller/jvm.rb:57:in `collect'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/instrument/periodic_poller/base.rb:56:in `start'", "org/jruby/RubyArray.java:2577:in `map'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/instrument/periodic_pollers.rb:23:in `start'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/agent.rb:413:in `configure_metrics_collectors'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/agent.rb:80:in `initialize'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/runner.rb:454:in `create_agent'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/runner.rb:365:in `execute'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/logstash-core/lib/logstash/runner.rb:237:in `run'", "D:/IoT/logstash-6.8.5/logstash-6.8.5/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "D:\\IoT\\logstash-6.8.5\\logstash-6.8.5\\lib\\bootstrap\\environment.rb:73:in `<main>'"]}
[2022-02-09T17:39:49,320][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
Also, find the conf file-
input {
http {
host => "10.55.112.75"
port => 5291
threads => 10000
}
}
filter{
if([multiple] == "true") {
split {
field => "records"
}
mutate {
"rename" => {
"[records][type]" => "type"
"[records][user]" => "user"
"[records][org]" => "org"
"[records][location_time]" => "location_time"
"[records][address]" => "address"
"[records][location]" => "location"
"[records][latitude]" => "latitude"
"[records][longitude]" => "longitude"
"[records][altitude]" => "altitude"
"[records][minor]" => "minor"
"[records][major]" => "major"
"[records][duration]" => "duration"
"[records][device]" => "device"
"[records][range]" => "range"
"[records][org_pair]" => "org_pair"
"[records][user_pair]" => "user_pair"
"[records][contact_pair]" => "contact_pair"
"[records][infected]" => "infected"
"[records][bluetooth]" => "bluetooth"
"[records][internet]" => "internet"
"[records][contact_at_risk]" => "contact_at_risk"
"[records][notify_physical distancing_violation]" => "notify_physical distancing_violation"
"[records][notify_events]" => "notify_events"
"[records][service]" => "service"
"[records][status]" => "status"
"[records][facility_name]" => "facility_name"
"[records][location_level]" => "location_level"
"[records][app_version]" => "app_version"
}
}
mutate {
remove_field => [ "records" ]
}
}
mutate {
rename => {
"[headers][http_phone_type]" => "phone_type"
"[headers][http_os_version]" => "os_version"
"[headers][http_app_version]" => "app_version"
}
}
if([location] == "") {
mutate {
remove_field => [ "location" ]
}
}
if("proximity" in [message]) or ([type] == "proximity") or ("office_entry" in [message]) or ([type] == "office_entry") or ("office_exit" in [message]) or ([type] == "office_exit") or ("phone_setting_disabled" in [message]) or ([type] == "phone_setting_disabled") or ("phone_setting_enabled" in [message]) or ([type] == "phone_setting_enabled") or ("app_setting_disabled" in [message]) or ([type] == "app_setting_disabled") or ("app_setting_enabled" in [message]) or ([type] == "app_setting_enabled") or ("user_login" in [message]) or ([type] == "user_login") or ("user_logoff" in [message]) or ([type] == "user_logoff") or ("contact_support" in [message]) or ([type] == "contact_support") or ("password_change" in [message]) or ([type] == "password_change") {
json {
source => "message"
}
mutate {
remove_field => [ "headers", "@version", "host", "tags", "message" ]
}
if([location] == "") {
mutate {
remove_field => [ "location" ]
}
}
mutate {
add_field => { "location" => "%{latitude},%{longitude}"}
}
mutate {
add_field => { "duration_num" => "%{duration}"}
}
mutate {
add_field => { "altitude_num" => "%{altitude}"}
}
mutate {
convert => {
"duration_num" => "float"
"range" => "float"
"altitude_num" => "float"
}
}
if([altitude_num] < 0) {
mutate {
add_field => { "phone_altitude_num" => "%{altitude_num}"}
}
mutate {
remove_field => [ "altitude_num" ]
}
mutate {
remove_field => [ "altitude" ]
}
mutate {
add_field => { "altitude_num" => "0" }
}
mutate {
add_field => { "altitude" => "0" }
}
mutate {
convert => {
"altitude_num" => "float"
}
}
}
if([altitude_num] > 45) {
mutate {
add_field => { "phone_altitude_num" => "%{altitude_num}"}
}
mutate {
remove_field => [ "altitude_num" ]
}
mutate {
remove_field => [ "altitude" ]
}
mutate {
add_field => { "altitude_num" => "45" }
}
mutate {
add_field => { "altitude" => "45" }
}
mutate {
convert => {
"altitude_num" => "float"
}
}
}
mutate {
add_field => { "location_actualtime" => "%{location_time}"}
}
mutate {
add_field => { "insert_time" => "%{@timestamp}"}
}
mutate {
convert => {
"insert_time" => "integer"
}
}
mutate {
convert => {
"location_actualtime" => "integer"
}
}
date {
match => [ "location_actualtime", "UNIX_MS" ]
target => "@timestamp"
}
} else if("device_permissions" in [message]) {
json {
source => "message"
}
if([location] == "") {
mutate {
remove_field => [ "location" ]
}
}
mutate {
remove_field => [ "headers", "@version", "host", "tags", "message" ]
}
mutate {
add_field => { "device_permissions" => "true" }
}
mutate {
add_field => { "location_actualtime" => "%{location_time}"}
}
mutate {
add_field => { "insert_time" => "%{@timestamp}"}
}
mutate {
convert => {
"insert_time" => "integer"
}
}
mutate {
convert => {
"location_actualtime" => "integer"
}
}
date {
match => [ "location_actualtime", "UNIX_MS" ]
target => "@timestamp"
}
} else if("safe_declaration" in [message]) {
json {
source => "message"
}
if([location] == "") {
mutate {
remove_field => [ "location" ]
}
}
mutate {
remove_field => [ "headers", "@version", "host", "tags", "message" ]
}
mutate {
add_field => { "safe_declaration" => "true" }
}
mutate {
add_field => { "location_actualtime" => "%{location_time}"}
}
mutate {
add_field => { "insert_time" => "%{@timestamp}"}
}
mutate {
convert => {
"insert_time" => "integer"
}
}
mutate {
convert => {
"location_actualtime" => "integer"
}
}
date {
match => [ "location_actualtime", "UNIX_MS" ]
target => "@timestamp"
}
} else if("user_preferences" in [message]) {
json {
source => "message"
}
if([location] == "") {
mutate {
remove_field => [ "location" ]
}
}
mutate {
remove_field => [ "headers", "@version", "host", "tags", "message" ]
}
mutate {
add_field => { "user_preferences" => "true" }
}
mutate {
add_field => { "location_actualtime" => "%{location_time}"}
}
mutate {
add_field => { "insert_time" => "%{@timestamp}"}
}
mutate {
convert => {
"insert_time" => "integer"
}
}
mutate {
convert => {
"location_actualtime" => "integer"
}
}
date {
match => [ "location_actualtime", "UNIX_MS" ]
target => "@timestamp"
}
} else if("location" in [message]) {
json {
source => "message"
}
if([location] == "") {
mutate {
remove_field => [ "location" ]
}
}
mutate {
remove_field => [ "headers", "@version", "host", "tags", "message" ]
}
mutate {
add_field => { "contacttracing" => "true" }
}
mutate {
add_field => { "location" => "%{latitude},%{longitude}"}
}
mutate {
add_field => { "duration_num" => "%{duration}"}
}
mutate {
add_field => { "altitude_num" => "%{altitude}"}
}
mutate {
convert => {
"duration_num" => "float"
"range" => "float"
"altitude_num" => "float"
}
}
} else {
split {
terminator => "@"
}
mutate {
gsub => [
"message","\|",";"
]
}
grok {
match => [
"message", "(%{WORD:tenant});(%{DATA:username});(%{IPORHOST:machinename});(%{WORD:severity});(%{GREEDYDATA:eventid});(%{GREEDYDATA:logid});(%{WORD:eventtype});(%{NUMBER:eventtime});(%{NUMBER:month});(%{NUMBER:day});(%{NUMBER:year});(%{URIHOST:domain});(%{GREEDYDATA:details});(%{GREEDYDATA:collection});(%{GREEDYDATA:lat});(%{GREEDYDATA:lon})"
]
add_field => { "location" => "%{lat},%{lon}"}
add_field => { "eventmatched" => "true" }
add_field => { "device" => "%{machinename}"}
add_field => { "user" => "%{username}"}
add_field => { "location_time" => "%{eventtime}"}
add_field => { "location_actualtime" => "%{eventtime}"}
add_field => { "latitude" => "%{lat}"}
add_field => { "longitude" => "%{lon}"}
add_field => { "altitude" => "0.0"}
add_field => { "address" => "unknown"}
add_field => { "org" => "%{tenant}"}
add_field => { "address" => "unknown"}
add_field => { "contacttracing" => "true"}
break_on_match => true
}
if([contacttracing] == "true") {
mutate {
add_field => { "insert_time" => "%{@timestamp}"}
}
mutate {
convert => {
"insert_time" => "integer"
}
}
mutate {
convert => {
"location_actualtime" => "integer"
}
}
mutate {
add_field => { "altitude_num" => "%{altitude}"}
}
mutate {
convert => {
"altitude_num" => "float"
}
}
date {
match => [ "location_actualtime", "UNIX_MS" ]
target => "@timestamp"
}
}
if([eventmatched] != "true") {
grok {
match => [
"message", "(%{WORD:tenant});(%{DATA:username});(%{IPORHOST:machinename});(%{WORD:severity});(%{GREEDYDATA:eventid});(%{GREEDYDATA:logid});(%{WORD:eventtype});(%{NUMBER:eventtime});(%{NUMBER:month});(%{NUMBER:day});(%{NUMBER:year});(%{URIHOST:domain});(%{GREEDYDATA:details});(%{GREEDYDATA:collection})"
]
add_field => { "eventmatched" => "true" }
break_on_match => true
}
}
date {
match => [ "@timestamp", "UNIX_MS" ]
}
}
mutate {
add_field => ["hour","%{+HH}","week","%{+ww}","day_of_week","%{+e}","month","%{+MM}","year","%{+YYYY}","minute","%{+mm}","day","%{+dd}","second","%{+ss}"]
}
mutate {
add_field => ["hour_num","%{+HH}","week_num","%{+ww}","day_of_week_num","%{+e}","month_num","%{+MM}","year_num","%{+YYYY}","minute_num","%{+mm}","day_num","%{+dd}","second_num","%{+ss}"]
}
mutate {
convert => {
"day_num" => "integer"
"month_num" => "integer"
"week_num" => "integer"
"day_of_week_num" => "integer"
"year_num" => "integer"
"hour_num" => "integer"
"minute_num" => "integer"
"second_num" => "integer"
}
}
mutate {
remove_field => [ "message", "@version", "host", "headers", "tags" ]
remove_tag => [ "message", "@version", "host", "headers", "tags" ]
}
if([location] == "null") or ([location] == "") {
mutate {
remove_field => [ "location" ]
}
#we not only remove a "bad" location, we attempt to re-add it properly
mutate {
add_field => { "location" => "%{latitude},%{longitude}"}
}
mutate {
add_field => { "no_location" => "true"}
}
}
if ([type] != "office_entry") and ([type] != "office_exit") and ([type] != "proximity") {
mutate {
remove_field => [ "location" ]
}
}
if("" in [minor]) {
mutate {
add_field => { "minor_num" => "%{minor}" }
}
mutate {
convert => { "minor_num" => "integer" }
}
if [minor_num] <= 0 {
drop {
}
} else {
mutate {
remove_field => [ "minor_num" ]
}
}
}
if("" in [user]) {
mutate {
add_field => { "user_num" => "%{user}" }
}
mutate {
convert => { "user_num" => "integer" }
}
if [user_num] <= 0 {
drop {
}
} else {
mutate {
remove_field => [ "user_num" ]
}
}
}
}
output {
stdout {
codec => rubydebug
}
if [contacttracing] == "true" or [type] == "contacttracing" {
elasticsearch {
index => "contacts"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "contacts"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "contacts_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "contacts_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
} else if [proximity] == "true" or [type] == "proximity" {
elasticsearch {
index => "proximity"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "proximity"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "proximity_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "proximity_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
http {
url => "http://hipunwsmar07.ad.harman.com:5297"
http_method => "post"
content_type => "application/json"
format => "json"
}
http {
url => "http://hipunwsmar03.ad.harman.com:5297"
http_method => "post"
content_type => "application/json"
format => "json"
}
} else if [device_permissions] == "true" or [type] == "device_permissions" {
elasticsearch {
index => "device_permissions"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "device_permissions"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "device_permissions_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "device_permissions_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
} else if [safe_declaration] == "true" or [type] == "safe_declaration" {
elasticsearch {
index => "safe_declaration"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "safe_declaration"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "safe_declaration_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "safe_declaration_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
} else if [user_preferences] == "true" or [type] == "user_preferences" {
elasticsearch {
index => "user_preferences"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "user_preferences"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "user_preferences_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "user_preferences_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
} else if [type] == "office_entry" or [type] == "office_exit" or [type] == "phone_setting_disabled" or [type] == "phone_setting_enabled" or [type] == "app_setting_disabled" or [type] == "app_setting_enabled" or [type] == "user_login" or [type] == "user_logoff" or [type] == "contact_support" or [type] == "password_change" {
elasticsearch {
index => "%{type}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{type}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{type}_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{type}_%{org}"
document_type => "location"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
}
if [eventmatched] == "true" {
elasticsearch {
index => "%{tenant}_%{+YYYY.MM.dd}"
document_type => "events"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{tenant}_%{+YYYY.MM.dd}"
document_type => "events"
hosts => [ "hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{tenant}_%{+YYYY.MM.dd}"
document_type => "%{eventtype}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{tenant}_%{+YYYY.MM.dd}"
document_type => "%{eventtype}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
}
elasticsearch {
index => "%{tenant}"
document_type => "%{eventtype}_h%{month}_%{day}_%{year}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
document_id => "%{machinename}"
}
elasticsearch {
index => "%{tenant}"
document_type => "%{eventtype}_h%{month}_%{day}_%{year}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
document_id => "%{machinename}"
}
elasticsearch {
index => "mrbiot_%{tenant}"
document_type => "%{[type]}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
manage_template => false
}
elasticsearch {
index => "mrbiot_%{tenant}"
document_type => "%{[type]}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
manage_template => false
}
elasticsearch {
index => "mrbiotl_%{tenant}"
document_type => "%{[type]}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
manage_template => false
}
elasticsearch {
index => "mrbiotl_%{tenant}"
document_type => "%{[type]}"
hosts => ["hipunwsmar07.ad.harman.com:9200"]
manage_template => false
}
}
}