README.md in fluent-plugin-woothee-0.2.2 vs README.md in fluent-plugin-woothee-1.0.0

- old
+ new

@@ -1,133 +1,84 @@ # fluent-plugin-woothee -## WootheeOutput +'fluent-plugin-woothee' is a Fluentd filter plugin to parse UserAgent strings and to filter/drop specified categories of user terminals (like 'pc', 'smartphone' and so on). -'fluent-plugin-woothee' is a Fluentd plugin to parse UserAgent strings and to filter/drop specified categories of user terminals (like 'pc', 'smartphone' and so on). - 'woothee' is multi-language user-agent strings parser project. See: https://github.com/woothee/woothee ## Configuration -To add woothee parser result into matched messages: +To add woothee parser result into messages: - <match input.**> - type woothee - key_name agent - remove_prefix input - add_prefix merged - merge_agent_info yes - </match> + <label @accesslog> + <filter input.**> + @type woothee + key_name agent + merge_agent_info yes + </filter> + <match ...> + </match> + </label> -Output messages with tag 'merged.**' has attributes like 'agent\_name', 'agent\_category' and 'agent\_os' from woothee parser result. If you want to change attribute names, or want to merge more attributes of browser vendor and its version, write configurations as below: +Result messages has attributes like 'agent\_name', 'agent\_category' and 'agent\_os' from woothee parser result. If you want to change attribute names, or want to merge more attributes of browser vendor and its version, write configurations as below: - <match input.**> - type woothee - key_name agent - remove_prefix input - add_prefix merged - merge_agent_info yes - out_key_name ua_name - out_key_category ua_category - out_key_os ua_os - out_key_os_version ua_os_version - out_key_version ua_version - out_key_vendor ua_vendor - </match> + <label @accesslog> + <filter input.**> + @type woothee + key_name agent + merge_agent_info yes + + out_key_name ua_name + out_key_category ua_category + out_key_os ua_os + out_key_os_version ua_os_version + out_key_version ua_version + out_key_vendor ua_vendor + </filter> + <match ...> + </match> + </label> -To re-emit messages with specified user-agent categories (and merge woothee parser result), configure like this: +To pass messages only with specified user-agent categories (and merge woothee parser result), configure like this: - <match input.**> - type woothee - key_name agent - filter_categories pc,smartphone,mobilephone,appliance - remove_prefix input - add_prefix merged - merge_agent_info yes - </match> + <label @accesslog> + <filter input.**> + @type woothee + key_name agent + merge_agent_info yes + filter_categories pc,smartphone,mobilephone,appliance + </filter> # logs of other categories will be dropped + + # ... + </label> Or, you can specify categories to drop (and not to merge woothee result): - <match input.**> - type woothee - key_name agent - drop_categories crawler - remove_prefix input - add_prefix merged - merge_agent_info false # default - </match> + <label @accesslog> + <filter input.**> + @type woothee + key_name agent + merge_agent_info false # default + drop_categories crawler + </filter> + + # ... + </label> ### Fast Crawler Filter If you want to drop __almost__ all of messages with crawler's user-agent, and not to merge woothee result, you just specify plugin type: - <match input.**> - type woothee_fast_crawler_filter - key_name useragent - tag filtered - </match> - -'fluent-plugin-woothee' uses 'Woothee.is_crawler' of woothee with this configuration, fast and incomplete method to judge user-agent is crawler or not. -If you want to drop all of crawlers completely, specify 'type woothee' and 'drop_categories crawler'. - -## WootheeFilter - -This is filter version of 'fluent-plugin-woothee'. -Note that this filter version does not have rewrite tag functionality. - -## Configuration - -To add woothee parser result into filtered messages: - <filter input.**> - type woothee - key_name agent - merge_agent_info yes - </filter> - -Filtered messages with non-modified tag has attributes like 'agent\_name', 'agent\_category' and 'agent\_os' from woothee parser result. If you want to change attribute names, or want to merge more attributes of browser vendor and its version, write configurations as below: - - <filter input.**> - type woothee - key_name agent - merge_agent_info yes - out_key_name ua_name - out_key_category ua_category - out_key_os ua_os - out_key_os_version ua_os_version - out_key_version ua_version - out_key_vendor ua_vendor - </filter> - -To filter messages with specified user-agent categories (and merge woothee parser result), configure like this: - - <filter input.**> - type woothee - key_name agent - filter_categories pc,smartphone,mobilephone,appliance - merge_agent_info yes - </filter> - -Or, you can specify categories to drop (and not to merge woothee result): - - <filter input.**> - type woothee - key_name agent - drop_categories crawler - merge_agent_info false # default - </filter> - -### Fast Crawler Filter - -If you want to drop __almost__ all of messages with crawler's user-agent, and not to merge woothee result, you just specify plugin type: - - <filter input.**> - type woothee_fast_crawler_filter + @type woothee_fast_crawler_filter key_name useragent </filter> -'fluent-plugin-woothee' uses 'Woothee.is_crawler' of woothee with this configuration, fast and incomplete method to judge user-agent is crawler or not. +'fluent-plugin-woothee' uses 'Woothee.is\_crawler' of woothee with this configuration, fast and incomplete method to judge user-agent is crawler or not. If you want to drop all of crawlers completely, specify 'type woothee' and 'drop_categories crawler'. + +### Output plugin + +The output version of woothee plugin is not supported in versions for Fluentd v0.14. ## TODO * patches welcome!