Skip to content

Commit

Permalink
Support Elasticsearch Basic Auth
Browse files Browse the repository at this point in the history
  • Loading branch information
lmars committed May 9, 2014
1 parent ae5a26e commit 58b4b9e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ First, set the IP address and port where the agent can find the Elasticsearch in
# Set the host and port where to find Elasticsearch.
host = "192.168.1.42"
port = 9200
# Optional basic auth credentials
# username = "admin"
# password = "s3cr3t"
```

Select the network interface from which to capture the traffic. Packetbeat supports capturing all messages sent or received by the server on which it is installed. For this, use "any" as the device:
Expand Down
4 changes: 4 additions & 0 deletions packetbeat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
host = "localhost"
port = 9200

# Optional basic auth credentials
# username = "admin"
# password = "s3cr3t"

[interfaces]
# Select on which network interfaces to sniff. You can use the "any"
# keyword to sniff on all connected interfaces.
Expand Down
8 changes: 6 additions & 2 deletions publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ type tomlAgent struct {
Refresh_topology_freq int
}
type tomlMothership struct {
Host string
Port int
Host string
Port int
Username string
Password string
}

type Event struct {
Expand Down Expand Up @@ -264,6 +266,8 @@ func (publisher *PublisherType) Init() error {
// Set the Elasticsearch Host to Connect to
api.Domain = _Config.Elasticsearch.Host
api.Port = fmt.Sprintf("%d", _Config.Elasticsearch.Port)
api.Username = _Config.Elasticsearch.Username
api.Password = _Config.Elasticsearch.Password

INFO("Use %s:%s as publisher", api.Domain, api.Port)

Expand Down

0 comments on commit 58b4b9e

Please sign in to comment.