knes1 / elktail

Command line utility to query, search and tail EL (elasticsearch, logstash) logs
MIT License
197 stars 66 forks source link

format field that sometimes does not exist #12

Closed ghost closed 7 years ago

ghost commented 8 years ago

I use the elktail format: --format "%@timestamp %level %application.name %message %metadata"

sometimes the metadata exists, and is properly printed, but sometimes it's missing and in this case, elktail prints out %metadata:

2016-11-03T09:01:20.850Z info @hpe/quixy test no metadata %metadata 2016-11-03T09:01:35.560Z info @hpe/quixy test map[id:123 blah:blubb]

is there a way to make elktail print out the value if it exists, but discard the variable name if it doesn't?

knes1 commented 8 years ago

It's not possible right now, however, discarding the variable name seems like a reasonable choice in this situation. I will include this feature in next release.

ghost commented 7 years ago

thanks