Skip to content

Instantly share code, notes, and snippets.

@iamhowardtheduck
iamhowardtheduck / elastic-cloud-logs-8
Created February 6, 2024 15:16
Updated Elastic-Cloud-Logs Template
PUT _index_template/elastic-cloud-logs-8
{
"version": 1,
"priority": 1000,
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "elastic-cloud-logs",
"rollover_alias": "elastic-cloud-logs-8"
@iamhowardtheduck
iamhowardtheduck / chatgpt4all.sh
Last active January 24, 2024 21:33
ELCIA: Elastic & ChatGPT Integration Application
clear
echo -e "\n\n\n\n\n\n\n"
if [[ $EUID -eq 0 ]]; then
echo "This script must NOT be run as \"root\" OR as \"sudo $USER\"; please try again." 1>&2
exit 1
fi
sudo apt update -y
sudo apt install dialog git -y
#
# BEGIN WELCOME SCREEN & INITIAL UPDATING
@iamhowardtheduck
iamhowardtheduck / Home-Assistant_Data_Ingestion_for_Elasticsearch
Last active September 28, 2022 12:53
Home-Assistant_Data_Ingestion_for_Elasticsearch
# Comprises of the following and to be installed in this order:
# - Index template for field mapping
# - DevTool command for index creation
# - Ingest pipelines for conditional parsing (1 main and 16 conditional)
# - Logstash pipeline to query Home-Assistant states via an API; use this link to obtain your authorization from your Home-Assistant instance:
# -- https://developers.home-assistant.io/docs/api/rest/ --
# - A lot of blood, sweat, and tears (not really, this was fun!) ☺
### INDEX TEMPLATE ### (updated: 20220928)
@iamhowardtheduck
iamhowardtheduck / plex-mediaserver-networkservicebrowser
Created June 1, 2022 11:01
plex-mediaserver-networkservicebrowser-INW
PUT _ingest/pipeline/plex-mediaserver-networkservicebrowser
{
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"(?<event.name>SSDP departed) (?<event.reason>after not being seen for (?<plex.unseen_seconds>\\d+\\.\\d+) seconds)\\: %{IP:client.ip} \\(%{WORD:client.hostname}\\)",
"(?<event.name>SSDP departed) (?<event.reason>after not being seen for (?<plex.unseen_seconds>\\d+\\.\\d+) seconds)\\: %{IP:client.ip} \\((?<client.hostname>[^\\s][^\\(]+) \\(%{IP}\\)\\)",
"(?<event.name>SSDP arrived)\\: %{IP:client.ip} \\(%{WORD:client.hostname}\\)",
@iamhowardtheduck
iamhowardtheduck / plex
Last active May 26, 2023 21:17
Plex Pipeline
PUT _ingest/pipeline/plex
{
"processors": [
{
"set": {
"field": "event.module",
"value": "plex",
"ignore_failure": true
}
},
@iamhowardtheduck
iamhowardtheduck / weathermap.ndjson
Created July 1, 2021 15:27
Weather Map for Kibana
{"attributes":{"color":"#06fff7","description":"Weather WMS Feeds: Base radar & warning by county","name":"weather"},"coreMigrationVersion":"7.13.2","id":"a3a75b00-d9c9-11eb-a8e7-7b5dbc36345d","references":[],"type":"tag","updated_at":"2021-06-30T17:36:02.237Z","version":"WzIyMDM0LDNd"}
{"attributes":{"description":"","layerListJSON":"[{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"isAutoSelect\":true},\"id\":\"85f9ea6f-e4c6-449c-b9a8-c1af318e0afc\",\"label\":null,\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"visible\":true,\"style\":{\"type\":\"TILE\"},\"type\":\"VECTOR_TILE\"},{\"sourceDescriptor\":{\"type\":\"EMS_TMS\",\"id\":\"dark_map\",\"isAutoSelect\":false},\"id\":\"d2d55941-1943-4ab9-b19a-c5b80b1dcc89\",\"label\":\"Road map - Dark\",\"minZoom\":0,\"maxZoom\":24,\"alpha\":1,\"visible\":true,\"style\":{\"type\":\"TILE\"},\"type\":\"VECTOR_TILE\"},{\"sourceDescriptor\":{\"type\":\"WMS\",\"serviceUrl\":\"https://idpgis.ncep.noaa.gov/arcgis/services/NWS_Forecasts_Guidance_Warnings/watch_warn_adv/MapServer/WMS
@iamhowardtheduck
iamhowardtheduck / pfsense ingest pipeline
Last active July 18, 2021 13:38
pfsense Elastic ECS Compliant Ingest Pipeline for filterlog & openvpn (INW)
PUT _ingest/pipeline/plex
{
"processors": [
{
"set": {
"field": "event.module",
"value": "plex",
"ignore_failure": true
}
},
@iamhowardtheduck
iamhowardtheduck / fail2ban-ecs-pipeline
Last active May 30, 2021 18:36
Fail2Ban ECS Ingest Pipeline
PUT _ingest/pipeline/fail2ban-ecs
{
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"%{SYSLOGTIMESTAMP:timestamp} %{WORD:host.name} %{GREEDYDATA:message}"
],
"ignore_missing": true,
PUT _ingest/pipeline/RDK-searchResults-Raw
{
"version": 1,
"processors": [
{
"kv": {
"field": "Report",
"field_split": ",\\{",
"value_split": ":",
"strip_brackets": true,
@iamhowardtheduck
iamhowardtheduck / moloch-ecs
Last active January 14, 2021 14:55
Moloch ECS Conversion Pipeline
PUT _ingest/pipeline/moloch-ecs
{
"description": "Ingest Moloch indices in ECS format.",
"processors": [
{
"rename": {
"field": "dstIp",
"target_field": "destination.ip",
"description": "DESTINATION IP",
"ignore_missing": true,