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

Update http_response.go #4662

Conversation

dannybeeckman
Copy link

Because the URL is only available in the full url format in the database, I am not able to select (group/filter) a specific hostname in the http_response plugin.

AS IS:
http_response,result=success,server=https://www.google.com:443/search/,status_code=200 http_response_code=200i,response_time=0.00778448,result_code=0i,result_type="success" 1536565736000000000

TO BE:
http_response,host=www.google.com,method=GET,path=/search/,port=443,protocol=https,result=success,server=https://www.google.com:443/search/,status_code=200 http_response_code=200i,response_time=0.00778448,result_code=0i,result_type="success" 1536565736000000000

I wrote a simple improvement.

Copy link
Contributor

@glinton glinton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a use case for not wanting these new tags? If so, maybe they can be added conditionally.

Also, don't forget to gofmt your code.

@glinton glinton added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Sep 10, 2018
@danielnelson
Copy link
Contributor

As discussed in #4413, let's call the tag containing the hostname of the remote server source.

@dannybeeckman
Copy link
Author

Ok, changed the code to use source instead of domain, @danielnelson .

I applied the gofmt and it seemed to change indentation, is it correct as it should be, @glinton ?

@glinton
Copy link
Contributor

glinton commented Sep 11, 2018

It's still failing the tests, saying to run make fmt. Which version of go are you using?

@dannybeeckman
Copy link
Author

It's still failing the tests, saying to run make fmt. Which version of go are you using?

go version go1.11 linux/amd64

@danielnelson
Copy link
Contributor

Looks like the code in the commit is space indented, go fmt should convert to use tabs instead.

@glinton
Copy link
Contributor

glinton commented Oct 1, 2018

@dannybeeckman can you run make fmt again and commit the changes?

@dannybeeckman
Copy link
Author

@glinton I tried but I can't find what I did wrong. Maybe it is because I develop in my own repo instead of a branch?

@danielnelson
Copy link
Contributor

There are conflict markers in http_response.go, but once those are solved you will need to use gofmt with Go 1.10 for now, we will change this soon but right now the tests are looking for the 1.10 format.

@glinton
Copy link
Contributor

glinton commented Dec 6, 2018

@dannybeeckman are you using go 1.10? Also you'll need to undo the last commit where you pasted the terminal output to the end of the file. make fmt updates the file in place so you won't need to paste anything.

@sjwang90
Copy link
Contributor

Closing due to inactivity. Please feel free to re-open if you would like to continue this work.

@sjwang90 sjwang90 closed this Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants