Class: LogStruct::Log::Security::BlockedHost
- Inherits:
-
T::Struct
- Object
- T::Struct
- LogStruct::Log::Security::BlockedHost
- Extended by:
- T::Sig
- Includes:
- Interfaces::AdditionalDataField, Interfaces::CommonFields, Interfaces::RequestFields, LogStruct::Log::Shared::AddRequestFields, LogStruct::Log::Shared::MergeAdditionalDataFields, LogStruct::Log::Shared::SerializeCommon
- Defined in:
- lib/log_struct/log/security/blocked_host.rb
Constant Summary
Constants included from LogStruct::Log::Shared::MergeAdditionalDataFields
LogStruct::Log::Shared::MergeAdditionalDataFields::RESERVED_KEYS
Instance Method Summary collapse
Methods included from LogStruct::Log::Shared::AddRequestFields
Methods included from LogStruct::Log::Shared::SerializeCommon
#as_json, #serialize, #serialize_common
Methods included from Interfaces::CommonFields
Methods included from Interfaces::CommonFieldBase
#level, #serialize, #timestamp
Methods included from Interfaces::RequestFields
#http_method, #path, #referer, #source_ip, #user_agent
Methods included from LogStruct::Log::Shared::MergeAdditionalDataFields
Methods included from Interfaces::AdditionalDataField
Instance Method Details
#to_h ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/log_struct/log/security/blocked_host.rb', line 60 def to_h h = T.let({}, T::Hash[LogStruct::LogField, T.untyped]) h[LogField::Path] = path unless path.nil? h[LogField::HttpMethod] = http_method unless http_method.nil? h[LogField::SourceIp] = source_ip unless source_ip.nil? h[LogField::UserAgent] = user_agent unless user_agent.nil? h[LogField::Referer] = referer unless referer.nil? h[LogField::Message] = unless .nil? h[LogField::BlockedHost] = blocked_host unless blocked_host.nil? h[LogField::BlockedHosts] = blocked_hosts unless blocked_hosts.nil? h[LogField::XForwardedFor] = x_forwarded_for unless x_forwarded_for.nil? h[LogField::AllowedHosts] = allowed_hosts unless allowed_hosts.nil? h[LogField::AllowIpHosts] = allow_ip_hosts unless allow_ip_hosts.nil? h end |