Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function: debug() #188

Merged
merged 2 commits into from May 30, 2017
Merged

New function: debug() #188

merged 2 commits into from May 30, 2017

Conversation

@lennartkoopmann
Copy link
Member

@lennartkoopmann lennartkoopmann commented May 29, 2017

Added a new function that will log the string representation of any value that has been passed to it. I just found this immensely helpful when working with a lookup table result.

Example output:

2017-05-29 17:18:54,271 INFO : org.graylog.plugins.pipelineprocessor.ast.functions.Function - PIPELINE DEBUG: {city=com.maxmind.geoip2.record.City [ {"geoname_id":5375480,"names":{"de":"Mountain View","ru":"Маунтин-Вью","ja":"マウンテンビュー","en":"Mountain View","fr":"Mountain View","zh-CN":"芒廷维尤"}} ], continent=com.maxmind.geoip2.record.Continent [ {"code":"NA","geoname_id":6255149,"names":{"de":"Nordamerika","ru":"Северная Америка","pt-BR":"América do Norte","ja":"北アメリカ","en":"North America","fr":"Amérique du Nord","zh-CN":"北美洲","es":"Norteamérica"}} ], country=com.maxmind.geoip2.record.Country [ {"geoname_id":6252001,"iso_code":"US","names":{"de":"USA","ru":"США","pt-BR":"Estados Unidos","ja":"アメリカ合衆国","en":"United States","fr":"États-Unis","zh-CN":"美国","es":"Estados Unidos"}} ], location=com.maxmind.geoip2.record.Location [ {"accuracy_radius":1000,"latitude":37.386,"longitude":-122.0838,"metro_code":807,"time_zone":"America/Los_Angeles"} ], postal=com.maxmind.geoip2.record.Postal [ {"code":"94035"} ], registered_country=com.maxmind.geoip2.record.Country [ {"geoname_id":6252001,"iso_code":"US","names":{"de":"USA","ru":"США","pt-BR":"Estados Unidos","ja":"アメリカ合衆国","en":"United States","fr":"États-Unis","zh-CN":"美国","es":"Estados Unidos"}} ], represented_country=com.maxmind.geoip2.record.RepresentedCountry [ {} ], subdivisions=[com.maxmind.geoip2.record.Subdivision [ {"geoname_id":5332921,"iso_code":"CA","names":{"de":"Kalifornien","ru":"Калифорния","pt-BR":"Califórnia","ja":"カリフォルニア州","en":"California","fr":"Californie","zh-CN":"加利福尼亚州","es":"California"}} ]], traits=com.maxmind.geoip2.record.Traits [ {"ip_address":"8.8.8.8","is_anonymous_proxy":false,"is_legitimate_proxy":false,"is_satellite_provider":false} ]}
Added a new function that will log the string represntation of any value that has been passed to it. I just found this immensely helpful when working with a lookup table result.

(cherry picked from commit fbe8cfb81e8c90f4b299c54cae8594642a57bec0)
@kroepke kroepke self-requested a review May 29, 2017
@kroepke kroepke added this to the 2.3.0 milestone May 29, 2017
@kroepke
Copy link
Member

@kroepke kroepke commented May 29, 2017

me gusta!

@@ -0,0 +1,45 @@
package org.graylog.plugins.pipelineprocessor.functions.debug;

This comment has been minimized.

@kroepke

kroepke May 29, 2017
Member

This file is missing a license header, could you please run mvn license:format and push the result?

Copy link
Member

@kroepke kroepke left a comment

just needs the updated license header

@lennartkoopmann
Copy link
Member Author

@lennartkoopmann lennartkoopmann commented May 29, 2017

Done!

Copy link
Member

@kroepke kroepke left a comment

lgtm

@kroepke kroepke merged commit d661b78 into master May 30, 2017
3 checks passed
3 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@garybot2
graylog-project/pr Jenkins build graylog-project-pr-snapshot 154 has succeeded
Details
@kroepke kroepke deleted the debug-function branch May 30, 2017
joschi pushed a commit to Graylog2/documentation that referenced this pull request Nov 15, 2017
jalogisch added a commit to Graylog2/documentation that referenced this pull request Nov 15, 2017
* Add documentation for the debug() function

Refs Graylog2/graylog-plugin-pipeline-processor#188

* Add example for debug() function
jalogisch added a commit to Graylog2/documentation that referenced this pull request Nov 15, 2017
* Add documentation for the debug() function

Refs Graylog2/graylog-plugin-pipeline-processor#188

* Add example for debug() function
jalogisch added a commit to Graylog2/documentation that referenced this pull request Nov 15, 2017
* Add documentation for the debug() function

Refs Graylog2/graylog-plugin-pipeline-processor#188

* Add example for debug() function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants