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
function sematextLogger (url, token) { | |
var sematextUrl = url || `https://logsene-receiver.sematext.com/${token}/_bulk/` | |
var logBuffer = '' | |
let consoleLog = console.log | |
let lineCount = 0 | |
const sessionId = /SESS\w*ID=([^;]+)/i.test(document.cookie) ? RegExp.$1 : false | |
let consoleFunctions = { | |
debug: console.debug, | |
error: console.error, | |
warn: console.warn, |
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
<html> | |
<body> | |
<script> | |
(function () { | |
const sematextLogToken = 'c0e39f27-xxxx-xxxx-9f27-8818a4f0b59d' | |
var sematextUrl = `https://logsene-receiver.sematext.com/${sematextLogToken}/_bulk/` | |
var logBuffer = '' | |
let consoleLog = console.log | |
let lineCount = 0 | |
const sessionId = /SESS\w*ID=([^;]+)/i.test(document.cookie) ? RegExp.$1 : false |
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
const Influx = require('influx') | |
const os = require('os') | |
const influx = new Influx.InfluxDB({ | |
host: 'spm-receiver.sematext.com', | |
port: 443, | |
database: 'metrics', | |
protocol: 'https' | |
}) | |
setInterval(() => { |
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
# st-agent-clusterrole.yml | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: sematext-agent | |
labels: | |
app: sematext-agent | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole |
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
options: | |
printStats: 60 | |
suppress: true | |
geoipEnabled: true | |
diskBufferDir: /tmp/sematext-logagent | |
input: | |
docker: | |
module: docker-logs | |
socket: /var/run/docker.sock |
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
var Logsene = require('winston-logsene') | |
var winston = require('winston') | |
const {createLogger, format} = require('winston') | |
// example for custom rewriter, e.g. add myServerIp field to all logs | |
var myServerIp = '10.0.0.12' | |
var logger = createLogger({ | |
levels: winston.config.npm.levels, |
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
# Script to putput dB level from microphone | |
# output: | |
# {"db": -87.03} | |
# {"db": -86.87} | |
# ... | |
while [ 1 ] | |
do | |
sox -b 32 -e unsigned-integer -r 96k -c 2 -d --clobber --buffer $((96000*2*10)) /tmp/soxrecording.wav trim 0 1 2> /dev/null | |
sox /tmp/soxrecording.wav -n stats 2>&1 >/dev/null | grep "RMS lev dB" | awk '{print "{\"db\": " $4 "}"}' | |
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
# Script to putput dB level from microphone | |
# output: | |
# {"db": -87.03} | |
# {"db": -86.87} | |
# ... | |
while [ 1 ] | |
do | |
sox -b 32 -e unsigned-integer -r 96k -c 2 -d --clobber --buffer $((96000*2*10)) /tmp/soxrecording.wav trim 0 1 2> /dev/null | |
sox /tmp/soxrecording.wav -n stats 2>&1 >/dev/null | grep "RMS lev dB" | awk '{print "{\"db\": " $4 "}"}' | |
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
// usage: node change-kibana-index.js 'objects_file.json' 'wazuh-alerts-*' TOKEN_wazuh_alerts | |
var fs = require('fs') | |
var kibanaObjects = JSON.parse(fs.readFileSync(process.argv[2])) | |
var newKibanaObjects = kibanaObjects.map(function (o) { | |
if (o._source && o._source.kibanaSavedObjectMeta && o._source.kibanaSavedObjectMeta.searchSourceJSON) { | |
var source = JSON.parse(o._source.kibanaSavedObjectMeta.searchSourceJSON) | |
if (source.index === process.argv[3]) { | |
source.index = process.argv[4] | |
} |
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
input: | |
docker-prometheus: | |
module: command | |
# connect to metrics endpoint | |
command: curl http://127.0.0.1:9323/metrics | |
sourceName: prometheus_metrics | |
debug: false | |
# scrape data every 10 seconds | |
restart: 10 |
NewerOlder