hi,
cat /etc/logstash/conf.d/openedr.conf for the below pipeline
input {
beats {
port => 5044
}
generator {
message => '{"baseEventType":1,"baseType":1,"childProcess":{"cmdLine":"C:\Windows\system32\svchost.exe -k netsvcs -p -s gpsvc","creationTime":1714556553033,"elevationType":1,"flsVerdict":3,"id":5349677356,"imageHash":"445f5f38396f0e3ee50a1d8","imagePath":"C:\Windows\System32\svchost.exe","pid":14048,"scriptContent":"","verdict":1},"customerId":"","deviceName":"IZDT-6","endpointId":"","eventType":null,"processes":[{"creationTime":171430626,"flsVerdict":3,"id":13324682947529074784,"imageHash":"2dfb00cd9a44a8a016452e1df01c0cec51870407","imagePath":"C:\Windows\System32\wininit.exe","pid":784,"userName":"SYSTEM@NT AUTHORITY","verdict":1},{"creationTime":1714392570787,"flsVerdict":3,"id":763785080847475,"imageHash":"e5704d8e560122c2a23de8912ae63b213d67c860","imagePath":"C:\Windows\System32\services.exe","pid":856,"userName":"SYS@NT AUTHORITY","verdict":1}],"sessionUser":"SYS@NT AUTHORITY","time":17145085,"type":"RP1.1","version":"1.1"}'
count => 1
}
}
filter {
mutate { gsub => [ "message", "[\]", "/" ] }
json{ source=>"message"}
ruby{
code => '
event.set("[childProcess][cmdLine]", event.get("[childProcess][cmdLine]").gsub("/", "\\\\") )
event.set("[childProcess][imagePath]", event.get("[childProcess][imagePath]").gsub("/", "\\\\") )
event.set("message", event.get("message").gsub("/", "\\\\") )
proc = event.get("processes")
proc.each_with_index do |value, index|
event.set("[processes][#{index}][imagePath]", event.get("[processes][#{index}][imagePath]").gsub("/", "\\\\"))
end
'
}
}
output {
stdout { codec => rubydebug{} }
}
i have added beats port as extra because the logs are in another server.
when i run the logstash it parsing some of the feilds for only 2 to 3 log entry and repeating some error .
o/p:
},
"time" => 17145085,
"version" => "1.1",
"sessionUser" => "SYS@NT AUTHORITY",
"@timestamp" => 2024-05-02T05:59:50.623008193Z,
"customerId" => "",
"message" => "{"baseEventType":1,"baseType":1,"childProcess":{"cmdLine":"C:\Windows\system32\svchost.exe -k netsvcs -p -s gpsvc","creationTime":1714556553033,"elevationType":1,"flsVerdict":3,"id":5349677356,"imageHash":"445f5f38396f0e3ee50a1d8","imagePath":"C:\Windows\System32\svchost.exe","pid":14048,"scriptContent":"","verdict":1},"customerId":"","deviceName":"IZDT-6","endpointId":"","eventType":null,"processes":[{"creationTime":171430626,"flsVerdict":3,"id":13324682947529074784,"imageHash":"2dfb00cd9a44a8a016452e1df01c0cec51870407","imagePath":"C:\Windows\System32\wininit.exe","pid":784,"userName":"SYSTEM@NT AUTHORITY","verdict":1},{"creationTime":1714392570787,"flsVerdict":3,"id":763785080847475,"imageHash":"e5704d8e560122c2a23de8912ae63b213d67c860","imagePath":"C:\Windows\System32\services.exe","pid":856,"userName":"SYS@NT AUTHORITY","verdict":1}],"sessionUser":"SYS@NT AUTHORITY","time":17145085,"type":"RP1.1","version":"1.1"}",
"endpointId" => "",
"childProcess" => {
"cmdLine" => "C:\Windows\system32\svchost.exe -k netsvcs -p -s gpsvc",
"flsVerdict" => 3,
"elevationType" => 1,
"id" => 5349677356,
"imageHash" => "445f5f38396f0e3ee50a1d8",
"creationTime" => 1714556553033,
"imagePath" => "C:\Windows\System32\svchost.exe",
"pid" => 14048,
"scriptContent" => "",
"verdict" => 1
},
"event" => {
"original" => "{"baseEventType":1,"baseType":1,"childProcess":{"cmdLine":"C:\Windows\system32\svchost.exe -k netsvcs -p -s gpsvc","creationTime":1714556553033,"elevationType":1,"flsVerdict":3,"id":5349677356,"imageHash":"445f5f38396f0e3ee50a1d8","imagePath":"C:\Windows\System32\svchost.exe","pid":14048,"scriptContent":"","verdict":1},"customerId":"","deviceName":"IZDT-6","endpointId":"","eventType":null,"processes":[{"creationTime":171430626,"flsVerdict":3,"id":13324682947529074784,"imageHash":"2dfb00cd9a44a8a016452e1df01c0cec51870407","imagePath":"C:\Windows\System32\wininit.exe","pid":784,"userName":"SYSTEM@NT AUTHORITY","verdict":1},{"creationTime":1714392570787,"flsVerdict":3,"id":763785080847475,"imageHash":"e5704d8e560122c2a23de8912ae63b213d67c860","imagePath":"C:\Windows\System32\services.exe","pid":856,"userName":"SYS@NT AUTHORITY","verdict":1}],"sessionUser":"SYS@NT AUTHORITY","time":17145085,"type":"RP1.1","version":"1.1"}",
"sequence" => 0
}
}
[ERROR] 2024-05-02 11:29:56.746 [[main]<beats] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Beats port=>5044, id=>"875fa50123dc0a9dc3730a16fd05809d155d20bb15fdd4a07f21f6c301321990", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_cacf6798-fcf2-493f-9f8f-69736f8ba519", enable_metric=>true, charset=>"UTF-8">, host=>"0.0.0.0", ssl=>false, ssl_enabled=>false, ssl_client_authentication=>"none", ssl_verify_mode=>"none", ssl_peer_metadata=>false, include_codec_tag=>true, ssl_handshake_timeout=>10000, ssl_cipher_suites=>["TLS_AES_256_GCM_SHA384", "TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"], ssl_supported_protocols=>["TLSv1.2", "TLSv1.3"], client_inactivity_timeout=>60, executor_threads=>4, event_loop_threads=>0, add_hostname=>false, tls_min_version=>1, tls_max_version=>1.3>
Error: Address already in use
Exception: Java::JavaNet::BindException
Stack: sun.nio.ch.Net.bind0(Native Method)
sun.nio.ch.Net.bind(sun/nio/ch/Net.java:555)
sun.nio.ch.ServerSocketChannelImpl.netBind(sun/nio/ch/ServerSocketChannelImpl.java:337)
sun.nio.ch.ServerSocketChannelImpl.bind(sun/nio/ch/ServerSocketChannelImpl.java:294)
io.netty.channel.socket.nio.NioServerSocketChannel.doBind(io/netty/channel/socket/nio/NioServerSocketChannel.java:141)
io.netty.channel.AbstractChannel$AbstractUnsafe.bind(io/netty/channel/AbstractChannel.java:562)
io.netty.channel.DefaultChannelPipeline$HeadContext.bind(io/netty/channel/DefaultChannelPipeline.java:1334)
io.netty.channel.AbstractChannelHandlerContext.invokeBind(io/netty/channel/AbstractChannelHandlerContext.java:600)
io.netty.channel.AbstractChannelHandlerContext.bind(io/netty/channel/AbstractChannelHandlerContext.java:579)
io.netty.channel.DefaultChannelPipeline.bind(io/netty/channel/DefaultChannelPipeline.java:973)
io.netty.channel.AbstractChannel.bind(io/netty/channel/AbstractChannel.java:260)
io.netty.bootstrap.AbstractBootstrap$2.run(io/netty/bootstrap/AbstractBootstrap.java:356)
io.netty.util.concurrent.AbstractEventExecutor.runTask(io/netty/util/concurrent/AbstractEventExecutor.java:173)
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(io/netty/util/concurrent/AbstractEventExecutor.java:166)
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(io/netty/util/concurrent/SingleThreadEventExecutor.java:470)
io.netty.channel.nio.NioEventLoop.run(io/netty/channel/nio/NioEventLoop.java:569)
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(io/netty/util/concurrent/SingleThreadEventExecutor.java:997)
io.netty.util.internal.ThreadExecutorMap$2.run(io/netty/util/internal/ThreadExecutorMap.java:74)
io.netty.util.concurrent.FastThreadLocalRunnable.run(io/netty/util/concurrent/FastThreadLocalRunnable.java:30)
java.lang.Thread.run(java/lang/Thread.java:840)
[INFO ] 2024-05-02 11:29:57.748 [[main]<beats] Server - Starting server on port: 5044
[ERROR] 2024-05-02 11:30:03.766 [[main]<beats] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Beats port=>5044, id=>"875fa50123dc0a9dc3730a16fd05809d155d20bb15fdd4a07f21f6c301321990", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_cacf6798-fcf2-493f-9f8f-69736f8ba519", enable_metric=>true, charset=>"UTF-8">, host=>"0.0.0.0", ssl=>false, ssl_enabled=>false, ssl_client_authentication=>"none", ssl_verify_mode=>"none", ssl_peer_metadata=>false, include_codec_tag=>true, ssl_handshake_timeout=>10000, ssl_cipher_suites=>["TLS_AES_256_GCM_SHA384", "TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"], ssl_supported_protocols=>["TLSv1.2", "TLSv1.3"], client_inactivity_timeout=>60, executor_threads=>4, event_loop_threads=>0, add_hostname=>false, tls_min_version=>1, tls_max_version=>1.3>
Error: Address already in use
Exception: Java::JavaNet::BindException
Stack: sun.nio.ch.Net.bind0(Native Method)
sun.nio.ch.Net.bind(sun/nio/ch/Net.java:555)
sun.nio.ch.ServerSocketChannelImpl.netBind(sun/nio/ch/ServerSocketChannelImpl.java:337)
sun.nio.ch.ServerSocketChannelImpl.bind(sun/nio/ch/ServerSocketChannelImpl.java:294)
io.netty.channel.socket.nio.NioServerSocketChannel.doBind(io/netty/channel/socket/nio/NioServerSocketChannel.java:141)
io.netty.channel.AbstractChannel$AbstractUnsafe.bind(io/netty/channel/AbstractChannel.java:562)
io.netty.channel.DefaultChannelPipeline$HeadContext.bind(io/netty/channel/DefaultChannelPipeline.java:1334)
io.netty.channel.AbstractChannelHandlerContext.invokeBind(io/netty/channel/AbstractChannelHandlerContext.java:600)
io.netty.channel.AbstractChannelHandlerContext.bind(io/netty/channel/AbstractChannelHandlerContext.java:579)
io.netty.channel.DefaultChannelPipeline.bind(io/netty/channel/DefaultChannelPipeline.java:973)
io.netty.channel.AbstractChannel.bind(io/netty/channel/AbstractChannel.java:260)
io.netty.bootstrap.AbstractBootstrap$2.run(io/netty/bootstrap/AbstractBootstrap.java:356)
io.netty.util.concurrent.AbstractEventExecutor.runTask(io/netty/util/concurrent/AbstractEventExecutor.java:173)
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(io/netty/util/concurrent/AbstractEventExecutor.java:166)
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(io/netty/util/concurrent/SingleThreadEventExecutor.java:470)
io.netty.channel.nio.NioEventLoop.run(io/netty/channel/nio/NioEventLoop.java:569)
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(io/netty/util/concurrent/SingleThreadEventExecutor.java:997)
io.netty.util.internal.ThreadExecutorMap$2.run(io/netty/util/internal/ThreadExecutorMap.java:74)
io.netty.util.concurrent.FastThreadLocalRunnable.run(io/netty/util/concurrent/FastThreadLocalRunnable.java:30)
java.lang.Thread.run(java/lang/Thread.java:840)
[INFO ] 2024-05-02 11:30:04.769 [[main]<beats] Server - Starting server on port: 5044
[ERROR] 2024-05-02 11:30:10.790 [[main]<beats] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Beats port=>5044, id=>"875fa50123dc0a9dc3730a16fd05809d155d20bb15fdd4a07f21f6c301321990", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_cacf6798-fcf2-493f-9f8f-69736f8ba519", enable_metric=>true, charset=>"UTF-8">, host=>"0.0.0.0", ssl=>false, ssl_enabled=>false, ssl_client_authentication=>"none", ssl_verify_mode=>"none", ssl_peer_metadata=>false, include_codec_tag=>true, ssl_handshake_timeout=>10000, ssl_cipher_suites=>["TLS_AES_256_GCM_SHA384", "TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"], ssl_supported_protocols=>["TLSv1.2", "TLSv1.3"], client_inactivity_timeout=>60, executor_threads=>4, event_loop_threads=>0, add_hostname=>false, tls_min_version=>1, tls_max_version=>1.3>
Error: Address already in use
Exception: Java::JavaNet::BindException
Stack: sun.nio.ch.Net.bind0(Native Method)
sun.nio.ch.Net.bind(sun/nio/ch/Net.java:555)
sun.nio.ch.ServerSocketChannelImpl.netBind(sun/nio/ch/ServerSocketChannelImpl.java:337)
sun.nio.ch.ServerSocketChannelImpl.bind(sun/nio/ch/ServerSocketChannelImpl.java:294)
io.netty.channel.socket.nio.NioServerSocketChannel.doBind(io/netty/channel/socket/nio/NioServerSocketChannel.java:141)
io.netty.channel.AbstractChannel$AbstractUnsafe.bind(io/netty/channel/AbstractChannel.java:562)
io.netty.channel.DefaultChannelPipeline$HeadContext.bind(io/netty/channel/DefaultChannelPipeline.java:1334)
io.netty.channel.AbstractChannelHandlerContext.invokeBind(io/netty/channel/AbstractChannelHandlerContext.java:600)
io.netty.channel.AbstractChannelHandlerContext.bind(io/netty/channel/AbstractChannelHandlerContext.java:579)
io.netty.channel.DefaultChannelPipeline.bind(io/netty/channel/DefaultChannelPipeline.java:973)
io.netty.channel.AbstractChannel.bind(io/netty/channel/AbstractChannel.java:260)
io.netty.bootstrap.AbstractBootstrap$2.run(io/netty/bootstrap/AbstractBootstrap.java:356)
io.netty.util.concurrent.AbstractEventExecutor.runTask(io/netty/util/concurrent/AbstractEventExecutor.java:173)
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(io/netty/util/concurrent/AbstractEventExecutor.java:166)
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(io/netty/util/concurrent/SingleThreadEventExecutor.java:470)
io.netty.channel.nio.NioEventLoop.run(io/netty/channel/nio/NioEventLoop.java:569)
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(io/netty/util/concurrent/SingleThreadEventExecutor.java:997)
io.netty.util.internal.ThreadExecutorMap$2.run(io/netty/util/internal/ThreadExecutorMap.java:74)
io.netty.util.concurrent.FastThreadLocalRunnable.run(io/netty/util/concurrent/FastThreadLocalRunnable.java:30)
java.lang.Thread.run(java/lang/Thread.java:840)
[INFO ] 2024-05-02 11:30:11.793 [[main]<beats] Server - Starting server on port: 5044
[ERROR] 2024-05-02 11:30:17.812 [[main]<beats] javapipeline - A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Beats port=>5044, id=>"875fa50123dc0a9dc3730a16fd05809d155d20bb15fdd4a07f21f6c301321990", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_cacf6798-fcf2-493f-9f8f-69736f8ba519", enable_metric=>true, charset=>"UTF-8">, host=>"0.0.0.0", ssl=>false, ssl_enabled=>false, ssl_client_authentication=>"none", ssl_verify_mode=>"none", ssl_peer_metadata=>false, include_codec_tag=>true, ssl_handshake_timeout=>10000, ssl_cipher_suites=>["TLS_AES_256_GCM_SHA384", "TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256"], ssl_supported_protocols=>["TLSv1.2", "TLSv1.3"], client_inactivity_timeout=>60, executor_threads=>4, event_loop_threads=>0, add_hostname=>false, tls_min_version=>1, tls_max_version=>1.3>
Error: Address already in use
Exception: Java::JavaNet::BindException
Stack: sun.nio.ch.Net.bind0(Native Method)
sun.nio.ch.Net.bind(sun/nio/ch/Net.java:555)
sun.nio.ch.ServerSocketChannelImpl.netBind(sun/nio/ch/ServerSocketChannelImpl.java:337)
sun.nio.ch.ServerSocketChannelImpl.bind(sun/nio/ch/ServerSocketChannelImpl.java:294)
io.netty.channel.socket.nio.NioServerSocketChannel.doBind(io/netty/channel/socket/nio/NioServerSocketChannel.java:141)
io.netty.channel.AbstractChannel$AbstractUnsafe.bind(io/netty/channel/AbstractChannel.java:562)
io.netty.channel.DefaultChannelPipeline$HeadContext.bind(io/netty/channel/DefaultChannelPipeline.java:1334)
io.netty.channel.AbstractChannelHandlerContext.invokeBind(io/netty/channel/AbstractChannelHandlerContext.java:600)
io.netty.channel.AbstractChannelHandlerContext.bind(io/netty/channel/AbstractChannelHandlerContext.java:579)
io.netty.channel.DefaultChannelPipeline.bind(io/netty/channel/DefaultChannelPipeline.java:973)
io.netty.channel.AbstractChannel.bind(io/netty/channel/AbstractChannel.java:260)
io.netty.bootstrap.AbstractBootstrap$2.run(io/netty/bootstrap/AbstractBootstrap.java:356)
io.netty.util.concurrent.AbstractEventExecutor.runTask(io/netty/util/concurrent/AbstractEventExecutor.java:173)
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(io/netty/util/concurrent/AbstractEventExecutor.java:166)
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(io/netty/util/concurrent/SingleThreadEventExecutor.java:470)
io.netty.channel.nio.NioEventLoop.run(io/netty/channel/nio/NioEventLoop.java:569)
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(io/netty/util/concurrent/SingleThreadEventExecutor.java:997)
io.netty.util.internal.ThreadExecutorMap$2.run(io/netty/util/internal/ThreadExecutorMap.java:74)
io.netty.util.concurrent.FastThreadLocalRunnable.run(io/netty/util/concurrent/FastThreadLocalRunnable.java:30)
java.lang.Thread.run(java/lang/Thread.java:840)
^C[WARN ] 2024-05-02 11:30:18.260 [SIGINT handler] runner - SIGINT received. Shutting down.
[INFO ] 2024-05-02 11:30:18.815 [[main]<beats] Server - Starting server on port: 5044
^C[FATAL] 2024-05-02 11:30:19.643 [SIGINT handler] runner - SIGINT received. Terminating immediately..
^Croot@freeipa:/usr/share/logstash# cat /etc/logstash/conf.d/openedr.conf
if i mention elasticsearch in the output plugin it not showing any logs in discover>kibana
same output in the console.