Skip to content

Instantly share code, notes, and snippets.

@tmuth
tmuth / fio-HEC.sh
Created April 3, 2018 17:09
Run fio and send results to splunk HTTP Event Collector
#!/bin/bash
SPLUNK_HOST=localhost
HEC_PORT=8088
HEC_TOKEN=ba8e11d0-0a1f-4f41-a5c6-c660e8655b02
HEC_PROTOCOL=http
file_name=`hostname`"_"$(date '+%Y-%m-%d_%H.%M.%S')".json"
host_name=`hostname`
epoc_time=`date +%s`
CREATE OR REPLACE TYPE clob_rec AS OBJECT (
num_characters number,
the_clob clob
);
CREATE OR REPLACE TYPE clob_tbl AS TABLE OF clob_rec;
select * FROM TABLE(clob_tbl_fn(30000));
@tmuth
tmuth / nginx.conf
Created June 20, 2019 20:11
nginx Proxy for Splunk HEC
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
@tmuth
tmuth / simple-splunk-GET-search.py
Last active May 20, 2021 13:22
Simple get search to pandas data frame
import urllib
import requests
import aiohttp
from pprint import pprint
# disable SSL warnings
import urllib3
urllib3.disable_warnings()
#df = dd.read_csv(filename)
select /*+ 2 buckets */ ora_hash(last_name,1) the_hash, last_name from customers where rownum <= 10;
THE_HASH LAST_NAME
---------- --------------------------------------------------
1 Brown
0 Riddell
0 Lawrence
1 Bartlett
1 Kenny
0 Williams
from dask.distributed import Client, progress
client = Client(threads_per_worker=8, n_workers=2)
client
import urllib
import requests
import aiohttp
from pprint import pprint
import dask
import dask.dataframe as dd