Skip to content

Commit

Permalink
Support setting the Elasticsearch protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
lmars committed May 9, 2014
1 parent 58b4b9e commit 912a462
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ First, set the IP address and port where the agent can find the Elasticsearch in
host = "192.168.1.42"
port = 9200
# Optional protocol
# protocol = "https"
# Optional basic auth credentials
# username = "admin"
# password = "s3cr3t"
Expand Down
3 changes: 3 additions & 0 deletions packetbeat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
host = "localhost"
port = 9200

# Optional protocol
# protocol = "https"

# Optional basic auth credentials
# username = "admin"
# password = "s3cr3t"
Expand Down
7 changes: 6 additions & 1 deletion publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type tomlAgent struct {
type tomlMothership struct {
Host string
Port int
Protocol string
Username string
Password string
}
Expand Down Expand Up @@ -269,7 +270,11 @@ func (publisher *PublisherType) Init() error {
api.Username = _Config.Elasticsearch.Username
api.Password = _Config.Elasticsearch.Password

INFO("Use %s:%s as publisher", api.Domain, api.Port)
if _Config.Elasticsearch.Protocol != "" {
api.Protocol = _Config.Elasticsearch.Protocol
}

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

publisher.name = _Config.Agent.Name
if len(publisher.name) == 0 {
Expand Down

0 comments on commit 912a462

Please sign in to comment.