This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/tmp/sandbox | |
❯ jruby -v | |
jruby 9.4.7.0 (3.1.4) 2024-04-29 597ff08ac1 OpenJDK 64-Bit Server VM 17.0.9+9 on 17.0.9+9 +jit [arm64-darwin] | |
/tmp/sandbox | |
❯ git clone [email protected]:logstash-plugins/logstash-input-salesforce.git | |
Cloning into 'logstash-input-salesforce'... | |
remote: Enumerating objects: 331, done. | |
remote: Counting objects: 100% (57/57), done. | |
remote: Compressing objects: 100% (21/21), done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# env var: | |
# keystore: | |
# pipeline.workers = default to cpu cores | |
❯ docker run docker.elastic.co/logstash/logstash-full:8.16.0-SNAPSHOT sh -c 'rm config/logstash.keystore && echo 1 | bin/logstash -e "" | grep pipeline.workers' | |
[2024-08-09T16:06:29,979][INFO ][logstash.javapipeline][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>10, [...] | |
# env var: 2 | |
# keystore: | |
# pipeline.workers = env var | |
❯ docker run -e PIPELINE_WORKERS="2" docker.elastic.co/logstash/logstash-full:8.16.0-SNAPSHOT sh -c 'rm config/logstash.keystore && echo 1 | bin/logstash -e "" | grep pipeline.workers' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ cat with_copy/Dockerfile | |
FROM centos:7 | |
COPY logstash-8.13.2-linux-aarch64.tar.gz /tmp/logstash.tar.gz | |
RUN tar -zxf /tmp/logstash.tar.gz && rm /tmp/logstash.tar.gz | |
❯ docker build -q with_copy | |
sha256:fce85351f818038d93afbd4005ff4fe10a2d7771ce1e603a54f91300e4032d1e | |
❯ docker run -it fce85351f818038d93afbd4005ff4fe10a2d7771ce1e603a54f91300e4032d1e /logstash-8.13.2/bin/logstash -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ for type in inputs filters codecs outputs; do echo "List of $type"; cat ./logstash_node_stats.json | jq -r ".pipelines | map(.plugins.$type)[] | map(.name)[]" | sort | uniq -c | sort -k2; done | |
List of inputs | |
1 beats | |
2 jdbc | |
1 syslog | |
1 tcp | |
List of filters | |
1 clone | |
4 date | |
1 dissect |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ | |
/tmp/logstash-8.12.2 | |
❯ LS_JAVA_OPTS="-verbose:class" bin/logstash -e "input { generator { count => 1 } } output { stdout {} }" | |
Using bundled JDK: /tmp/logstash-8.12.2/jdk.app/Contents/Home | |
exec "/tmp/logstash-8.12.2/jdk.app/Contents/Home/bin/java" -cp "/tmp/logstash-8.12.2/vendor/jruby/lib/jruby.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/checker-qual-3.33.0.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/commons-codec-1.15.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/commons-compiler-3.1.0.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/commons-logging-1.2.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/error_prone_annotations-2.18.0.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/failureaccess-1.0.1.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/google-java-format-1.15.0.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/guava-32.1.2-jre.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/httpclient-4.5.13.jar:/tmp/logstash-8.12.2/logstash-core/lib/jars/httpcore-4.4.14.jar:/tmp/logstash-8.12.2/logstash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
HOST = 'localhost' | |
PORT = 5555 | |
def connect_and_close | |
socket = TCPSocket.new(HOST, PORT) | |
linger = [1,0].pack('ii') | |
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger) | |
socket.close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# JRUBY_OPTS="-J-Xmx4g -J-Xms4g" ruby beats_writer_ssl.rb | |
require "socket" | |
require "thread" | |
require "zlib" | |
require "json" | |
require "openssl" | |
Thread.abort_on_exception = true | |
HOST="127.0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# written for python 2.7 | |
# | |
# CAKe : CEF Army Knife experiment | |
# A versatile CEF manipulation and generation tool | |
# | |
# Author : Gaetan Cardinal | |
# cardinal_gaetan |at| yahoo.fr | |
# | |
# Version: 0.2 | |
# Updated: Jan 2014 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# Script to test local Logstash instance for JNDI lookups (Log4j vulnerability) | |
# | |
# To run, copy script to Logstash folder and run: | |
# | |
# bin/ruby script.rb | |
# | |
# Script's steps: | |
# Step 1: setup environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'net/http' | |
def cert_from_url(url) | |
txt = Net::HTTP.get(URI(url)) | |
OpenSSL::X509::Certificate.new(txt) | |
end | |
LEAF_CERTIFICATE = OpenSSL::X509::Certificate.new %q[ | |
-----BEGIN CERTIFICATE----- |
NewerOlder