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

Use log.source.address instead of log.source.ip for network inputs #9487

Merged
merged 5 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha1...master[Check the HEAD d
- Don't generate incomplete configurations when logs collection is disabled by hints. {pull}9305[9305]
- Stop runners disabled by hints after previously being started. {pull}9305[9305]
- Fix saved objects in filebeat haproxy dashboard. {pull}9417[9417]
- Use `log.source.address` instead of `log.source.ip` for network input sources. {pull}9487[9487]

*Heartbeat*

Expand Down
5 changes: 4 additions & 1 deletion dev-tools/ecs-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
alias: true

- from: source
to: ["log.file.path", "log.source.ip"]
to:
- log.file.path
- log.source.ip
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume we can remove log.source.ip from this list?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure, I kept it in case it was being used, or was going to be used in other places, but I have no problem with removing it.

Copy link
Contributor

Choose a reason for hiding this comment

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

It "should" not be used anywhere else. Can you also do a quick search to make sure this is the case and remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I also remove it from fields.common.yml?

- log.source.address
alias: false

- from: beat.name
Expand Down
6 changes: 6 additions & 0 deletions filebeat/_meta/fields.common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
description: >
Source IP from which the log event was read / sent from.

- name: log.source.address
type: keyword
required: false
description: >
Source address from which the log event was read / sent from.

- name: log.offset
type: long
required: false
Expand Down
12 changes: 12 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4709,6 +4709,18 @@ required: False
Source IP from which the log event was read / sent from.


--

*`log.source.address`*::
+
--
type: keyword

required: False

Source address from which the log event was read / sent from.


--

*`log.offset`*::
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion filebeat/input/syslog/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func createEvent(ev *event, metadata inputsource.NetworkMetadata, timezone *time
"message": strings.TrimRight(ev.Message(), "\n"),
"log": common.MapStr{
"source": common.MapStr{
"ip": metadata.RemoteAddr.String(),
"address": metadata.RemoteAddr.String(),
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions filebeat/input/syslog/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestWhenPriorityIsSet(t *testing.T) {
expected := common.MapStr{
"log": common.MapStr{
"source": common.MapStr{
"ip": "127.0.0.1",
"address": "127.0.0.1",
},
},
"message": "hello world",
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestWhenPriorityIsNotSet(t *testing.T) {
expected := common.MapStr{
"log": common.MapStr{
"source": common.MapStr{
"ip": "127.0.0.1",
"address": "127.0.0.1",
},
},
"message": "hello world",
Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/tcp/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func createEvent(raw []byte, metadata inputsource.NetworkMetadata) *util.Data {
"message": string(raw),
"log": common.MapStr{
"source": common.MapStr{
"ip": metadata.RemoteAddr.String(),
"address": metadata.RemoteAddr.String(),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/tcp/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ func TestCreateEvent(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, string(message), m)

from, _ := event.GetValue("log.source.ip")
from, _ := event.GetValue("log.source.address")
assert.Equal(t, ip, from)
}
2 changes: 1 addition & 1 deletion filebeat/input/udp/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func NewInput(
"message": string(data),
"log": common.MapStr{
"source": common.MapStr{
"ip": metadata.RemoteAddr.String(),
"address": metadata.RemoteAddr.String(),
},
},
},
Expand Down