Fully working splunk-export script. Full re-write done.