Skip to content

Instantly share code, notes, and snippets.

@LukeMurphey
Last active June 29, 2018 16:55
Show Gist options
  • Save LukeMurphey/005552b508a6f6b6bc8d37e04f1d6073 to your computer and use it in GitHub Desktop.
Save LukeMurphey/005552b508a6f6b6bc8d37e04f1d6073 to your computer and use it in GitHub Desktop.
A Splunk snippet for examining how much you spend on Amazon per year downloaded from https://www.amazon.com/gp/b2b/reports #splunk
source="01-Jan-2006_to_29-Jun-2018.csv"
| eval _time=strptime('Shipment Date',"%m/%d/%y")
| rex field="Purchase Price Per Unit" "(?<price>[0-9.]+)"
| rex field="Shipment Date" "[0-9][0-9]/[0-9][0-9]/(?<year>([0-9][0-9]))"
| stats sum(price) as spent by year
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment