<div dir="ltr"><div><div>The token-string can be escaped using the same mechanism as char-to. Eg. \x3a for colon(:) etc.<br><br></div>Also, the tokenized field-type allows user to pick the field-type of each field on tokenized-fragment and it produces a multi-valued variable(its a json-array), similar to event.tags. <br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 30, 2014 at 4:33 PM, singh.janmejay <span dir="ltr"><<a href="mailto:singh.janmejay@gmail.com" target="_blank">singh.janmejay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br><br>This patch-set introduces a log-norm field-type called tokenized, which allows parsing of token-separated values.<br><br>A lot of applications such as nginx write fields in logs that are comma+space separated etc. For instance, nginx upstream_addrs field writes comma-separated ip+port combinations to access logs.<br><br>Parsing such logs takes significant amount of regex and exec-template work and leads to rather ugly solution for something as simple as tokenized string.<br><br>With this patch, parsing a list of ip-addresses separated by ', '(comma + space) for instance, would require a rule similar to:<br><br>rule=ips:%my_ips:tokenized:, :ipv4%<br><br>This requires a small patch to libestr as well, so this mail has 3 patches attached.<br><br>libestr patch: <br><br>0001-Changed-some-functions-that-don-t-modify-their-arg-t.patch<br><br>liblognorm patch:<br><br>0001-Moved-from-parser-receving-data-as-escaped-string-to.patch<br>0002-added-support-for-field_type-tokenized-which-parses-.patch<br><br>Patches go in order of prefix-number.<span class="HOEnZb"><font color="#888888"><br clear="all"></font></span></div></div><span class="HOEnZb"><font color="#888888"><div><div><div><div><div><div><br>-- <br>Regards,<br>Janmejay<br><a href="http://codehunk.wordpress.com" target="_blank">http://codehunk.wordpress.com</a><br>
</div></div></div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Janmejay<br><a href="http://codehunk.wordpress.com">http://codehunk.wordpress.com</a><br>
</div>