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

[LogStash] Failed to parse field [dns.resolved_ip] of type [ip] #9

Closed
nicpenning opened this issue Apr 8, 2020 · 2 comments
Closed

Comments

@nicpenning
Copy link
Contributor

Hello,

I am using the plugin filter mutate {copy =>{ "[ipaddr]"=> "[dns][resolved_ip]" } } and ipaddr contains multiple values ("127.0.0.1, 192.168.0.3, 192.168.0.4") and when I try to ingest this into ElasticSearch the field dns.resolved_ip is an IP so the error I am receiving is:
"status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [dns.resolved_ip] of type [ip] in document with id 'w3ZAWnEBlAHVcZpD_2dx'. Preview of field's value: '127.0.0.1, 192.168.0.3, 192.168.0.4'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"'127.0.0.1, 192.168.0.3, 192.168.0.4' is not an IP string literal."

I think the ipaddr value needs to be parsed and break out the values into an array to show the end result like this:
"dns": {
"resolved_ip": [
"127.0.0.1",
"192.168.0.3",
"192.168.0.4"
],

Instead of
"dns": {
"resolved_ip": [
"127.0.0.1, 192.168.0.3, 192.168.0.4"
],

Which is not an IP address but just a string of text.

Let me know if you need any clarifications. I am working on a solution to parse the ipaddr data but if you already have one, please provide!

Thanks!

@nicpenning
Copy link
Contributor Author

Resolved this error by adding this:

split => { "ipaddr" => ", " }

Right above line 174 (in the 40-fortigate_2_ecs pipeline):

copy =>{ "[ipaddr]"=> "[dns][resolved_ip]" }

copy =>{ "[ipaddr]"=> "[dns][resolved_ip]" }

nicpenning pushed a commit to nicpenning/fortinet-2-elasticsearch that referenced this issue Apr 8, 2020
@nicpenning
Copy link
Contributor Author

Fixed with PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant