Skip to content

Instantly share code, notes, and snippets.

View gingerwizard's full-sized avatar

Dale McDiarmid gingerwizard

View GitHub Profile
@gingerwizard
gingerwizard / process_signature.json
Last active June 6, 2017 09:57
Ingest Pipeline for Creating a process_signature field from Auditd in CEF
{
"description": "Pipeline for creating process_signature field",
"processors": [
{
"script": {
"lang": "painless",
"inline": "if (ctx.auditd?.log?.a0 != null) { ctx.process_signature = ctx.auditd.log.a0+'|'+ctx.auditd.log.a1+'|'+ctx.beat.name; }"
}
}
]
@gingerwizard
gingerwizard / update_process_signature.json
Last active June 6, 2017 10:03
Update By Query Request to add process_signature field
POST cef-*/_update_by_query
{
"query": {
"term": {
"auditd.log.record_type": {
"value": "EXECVE"
}
}
},
"script": {
{
"primary_image": {
"id": 56871
},
"on_offer": false,
"discount_amount": 0,
"default_price": 20.99,
"rating": 4,
"description": """upper_material_clothing:95% polyester, 5% spandex;productmodel_length:24.5 " (Size 8);pattern:plain;model_height:Our model is 71.5 " tall and is wearing size 8;washing_instructions:do not tumble dry;washing_instructions:machine wash at 30°C;washing_instructions:Machine wash on gentle cycle;sleeve_length_option:sleeveless;correct_fit:regular;shirt_collar_type:Mandarin collar;clothing_length:standard""",
"discount_percentage": 0,
@gingerwizard
gingerwizard / demo template
Created August 10, 2017 16:57
Template for main index on ecommerce demo
{
"cyclops": {
"aliases": {},
"mappings": {
"product": {
"properties": {
"attributes": {
"properties": {
"color": {
"type": "text",
@gingerwizard
gingerwizard / SQL Queries
Last active December 5, 2017 16:31
SQL Queries
1. Spotfire makes the following in order to identify column values for drill down
SELECT DISTINCT m1.applicant_ethnicity_name AS APPLICANTETHNICITYNAME FROM morgages_large m1 WHERE (m1.applicant_ethnicity_name IS NOT NULL) ORDER BY APPLICANTETHNICITYNAME
{
"error": {
"root_cause": [
{
"type": "planning_exception",
"reason": "Fail to plan items {UnplannedExec[Distinct[]]@1:8}"
This file has been truncated, but you can view the full file.
{
"took" : 7,
"timed_out" : false,
"_shards" : {
"total" : 15,
"successful" : 15,
"skipped" : 0,
"failed" : 0
},
"hits" : {
{
"password": "secret/eden/sec19/es_users/kibana_user",
"roles": [
"ama_app"
],
"full_name": "AMA App",
"email": "sa-admin@elastic.co"
}
import argparse
import json
import yaml
import os
import sys
parser = argparse.ArgumentParser()
#es details
parser.add_argument('--ecs_migration_file', dest='ecs_migration_file', required=False, default='./ecs-migration.yml')
int[] HS() {
return new int[] {
(int) 0x6a09e667L,
(int) 0xbb67ae85L,
(int) 0x3c6ef372L,
(int) 0xa54ff53aL,
(int) 0x510e527fL,
(int) 0x9b05688cL,
(int) 0x1f83d9abL,
(int) 0x5be0cd19L
@gingerwizard
gingerwizard / download
Created January 21, 2020 11:26
Code for image search
download_images.py
import argparse
import glob
import gzip
import imghdr
import urllib.request
import os
import ast
import multiprocessing