mattgodbolt / zindex

Create an index on a compressed text file
BSD 2-Clause "Simplified" License
622 stars 37 forks source link

newbie error.... can't get simple example to work #17

Closed joshuacalloway closed 9 years ago

joshuacalloway commented 9 years ago

Went to meetup last night. Tried simple example as shown in presentation.


jc:/2nddrive/play/zindex/build/Release/tmp$ zgrep -E '^{"eventId":1234,' audit.log.gz {"eventId":1234, "value":"garbage1234"} jc:/2nddrive/play/zindex/build/Release/tmp$ ../zindex --regex '^{"eventId":([0-9]+),' --unique --numeric audit.log.gz ERROR: Invalid preceding regular expression in '^{"eventId":([0-9]+),' jc:/2nddrive/play/zindex/build/Release/tmp$ gzip -d audit.log.gz jc:/2nddrive/play/zindex/build/Release/tmp$ cat audit.log {"eventId":1234, "value":"garbage1234"} {"eventId":5678, "value":"garbage5678"}

mattgodbolt commented 9 years ago

Try escaping the { with a backslash or two: I played fast and loose on the slides with escaping to keep them shorter! (Oops!)

joshuacalloway commented 9 years ago

that worked

mattgodbolt commented 9 years ago

Great stuff; I'll update the slides. Sorry for the confusion!