Skip to content

Instantly share code, notes, and snippets.

@heinrichvk
Created September 28, 2015 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heinrichvk/8d3f7d4581bffea8de91 to your computer and use it in GitHub Desktop.
Save heinrichvk/8d3f7d4581bffea8de91 to your computer and use it in GitHub Desktop.
Scripts for loading data into Splunk, without tags.
#!/bin/bash
#2015-06-24T00:00:00Z = 1435093200000 ms
#2015-06-25T00:00:00Z = 1435179600000 ms
for ((q = 1; q < 101; q++)); do
echo 'sensor'$q
for (( i = 1435093200000; i < 1435179600000; i+=10000 )); do
v=$[100 + (RANDOM % 100)]$[1000 + (RANDOM % 1000)]
t=$[20 + RANDOM % 20].${v:1:2}${v:4:3}
p=$[0 + RANDOM % 3].${v:1:2}${v:4:3}
h=$[20 + RANDOM % 60].${v:1:2}${v:4:3}
echo series e:sensor$q m:temperature=$t m:humidity=$h m:precipitation=$p ms:$i | nc localhost 8081
done;
done
echo "Data loaded"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment