Skip to content

Commit cfc3f65

Browse files
committed
Merge branch 'feature/SCFF-5' into develop
2 parents b437d4b + 95aeecc commit cfc3f65

1,406 files changed

Lines changed: 864350 additions & 157 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
# Add any directories, files, or patterns you don't want to be tracked by version control
2-
internal-core
3-
firehose-to-sumologic*
4-
events/events.test
5-
.project
6-
*.swp
7-
.#*
8-
\#*
1+
product/
2+
release/
3+
firehose-to-sumologic.zip
94
my.db
10-
start-firehose.sh
11-
dist
12-
*pprof
135

Godeps/Godeps.json

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.lock

Lines changed: 114 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
package: bitbucket.org/mcplusa-ondemand/firehose-to-sumologic
2+
import:
3+
- package: github.com/Sirupsen/logrus
4+
version: v0.10.0
5+
subpackages:
6+
- hooks/syslog
7+
- package: github.com/alecthomas/template
8+
version: b867cc6ab45cece8143cfcc6fc9c77cf3f2c23c0
9+
subpackages:
10+
- parse
11+
- package: github.com/alecthomas/units
12+
version: 6b4e7dc5e3143b85ea77909c72caf89416fc2915
13+
- package: github.com/boltdb/bolt
14+
version: 4d30731e9122988d2012a9574c43f80f054a0d3b
15+
- package: github.com/cloudfoundry-community/go-cfclient
16+
version: c783aa0efe78706e9d98ffc4a84f0d42cd322ac8
17+
- package: github.com/cloudfoundry/noaa
18+
version: 0ca0d30d65c7422750132450593d402428dd2273
19+
subpackages:
20+
- consumer
21+
- consumer/internal
22+
- errors
23+
- package: github.com/cloudfoundry/sonde-go
24+
version: 81c3f6be579cf4337477a8b0d03852d0760b5801
25+
subpackages:
26+
- events
27+
- package: github.com/gogo/protobuf
28+
version: a4cceea7a401a73fefafd1a21fedbd4694124a82
29+
subpackages:
30+
- gogoproto
31+
- proto
32+
- protoc-gen-gogo/descriptor
33+
- package: github.com/gorilla/websocket
34+
version: a69d25be2fe2923a97c2af6849b2f52426f68fc0
35+
- package: github.com/mailru/easyjson
36+
version: 159cdb893c982e3d1bc6450322fedd514f9c9de3
37+
subpackages:
38+
- buffer
39+
- jlexer
40+
- jwriter
41+
- package: github.com/pkg/profile
42+
version: 8a808a6967b79da66deacfe508b26d398a69518f
43+
- package: golang.org/x/net
44+
version: 7dbad50ab5b31073856416cdcfeb2796d682f844
45+
subpackages:
46+
- context
47+
- package: golang.org/x/oauth2
48+
version: 2baa8a1b9338cf13d9eeb27696d761155fa480be
49+
subpackages:
50+
- internal
51+
- package: golang.org/x/sys
52+
version: 9d4e42a20653790449273b3c85e67d6d8bae6e2e
53+
subpackages:
54+
- unix
55+
- package: gopkg.in/alecthomas/kingpin.v2
56+
version: v2.1.11
57+
testImport:
58+
- package: github.com/onsi/ginkgo
59+
version: v1.2.0
60+
- package: github.com/onsi/gomega
61+
version: v1.0
62+
- package: github.com/stretchr/testify
63+
version: v1.1.4
64+
subpackages:
65+
- assert

main.go

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@ import (
1919
)
2020

2121
var (
22-
debug = true //debug", "Enable debug mode, print in console
23-
apiEndpoint = kingpin.Flag("api-endpoint", "Sumo Endpoint").String() //"https://api.bosh-lite.com"
24-
sumoEndpoint = kingpin.Flag("sumo-endpoint", "Sumo Endpoint").String()
22+
apiEndpoint = kingpin.Flag("api-endpoint", "Api Endpoint").OverrideDefaultFromEnvar("API_ENDPOINT").String()
23+
sumoEndpoint = kingpin.Flag("sumo-endpoint", "Sumo Endpoint").OverrideDefaultFromEnvar("SUMO_ENDPOINT").String()
2524
dopplerEndpoint = kingpin.Flag("doppler-endpoint", "Overwrite default doppler endpoint return by /v2/info").OverrideDefaultFromEnvar("DOPPLER_ENDPOINT").String()
2625
subscriptionId = kingpin.Flag("subscription-id", "Id for the subscription.").Default("firehose").OverrideDefaultFromEnvar("FIREHOSE_SUBSCRIPTION_ID").String()
27-
user = "firehose_user" //user created in CF, authorized to connect the firehose
28-
password = "firehose_password" // password created along with the firehose_user
29-
skipSSLValidation = kingpin.Flag("skip-ssl-validation", "Please don't").Default("false").OverrideDefaultFromEnvar("SKIP_SSL_VALIDATION").Bool()
30-
keepAlive, errK = time.ParseDuration("25s") //default
26+
user = kingpin.Flag("cloudfoundry-user", "Cloudfoundry User").OverrideDefaultFromEnvar("CLOUDFOUNDRY_USER").String() //user created in CF, authorized to connect the firehose
27+
password = kingpin.Flag("cloudfoundry-password", "Cloudfoundry Password").OverrideDefaultFromEnvar("CLOUDFOUNDRY_PASSWORD").String() // password created along with the firehose_user //kingpin.Flag("skip-ssl-validation", "Please don't").Default("false").OverrideDefaultFromEnvar("SKIP_SSL_VALIDATION").Bool()
28+
keepAlive, errK = time.ParseDuration("25s") //default
3129
wantedEvents = kingpin.Flag("events", fmt.Sprintf("Comma separated list of events you would like. Valid options are %s", eventRouting.GetListAuthorizedEventEvents())).Default("LogMessage").OverrideDefaultFromEnvar("EVENTS").String()
3230
boltDatabasePath = "my.db" //default
3331
tickerTime, errT = time.ParseDuration("60s") //Default
34-
eventsBatchSize = kingpin.Flag("log-events-batch-size", "Log Events Batch Size").Default("10").Int()
35-
sumoPostMinimumDelay = kingpin.Flag("sumo-Post-Minimum-Delay", "Sumo Post Minimum Delay").Default("500ms").Duration()
32+
eventsBatchSize = kingpin.Flag("log-events-batch-size", "Log Events Batch Size").OverrideDefaultFromEnvar("LOG_EVENTS_BATCH_SIZE").Int()
33+
sumoPostMinimumDelay = kingpin.Flag("sumo-post-minimum-delay", "Sumo Post Minimum Delay").OverrideDefaultFromEnvar("SUMO_POST_MINIMUM_DELAY").Duration()
3634
)
3735

3836
var (
@@ -53,17 +51,16 @@ func main() {
5351
logging.Info.Println("Sumo Endpoint: " + *sumoEndpoint)
5452
logging.Info.Println("Cloudfoundry Doppler Endpoint: " + *dopplerEndpoint)
5553
logging.Info.Println("Cloudfoundry Nozzle Subscription ID: " + *subscriptionId)
56-
logging.Info.Println("Cloudfoundry User: " + user)
57-
58-
logging.Info.Printf("Events Batch Size: [%d]\n", eventsBatchSize)
54+
logging.Info.Println("Cloudfoundry User: " + *user)
5955

56+
logging.Info.Printf("Events Batch Size: [%d]\n", *eventsBatchSize)
6057
logging.Info.Println("Starting firehose-to-sumo " + version)
6158

6259
c := cfclient.Config{
6360
ApiAddress: *apiEndpoint,
64-
Username: user,
65-
Password: password,
66-
SkipSslValidation: *skipSSLValidation,
61+
Username: *user,
62+
Password: *password,
63+
SkipSslValidation: true,
6764
}
6865
cfClient, _ := cfclient.NewClient(&c)
6966

@@ -105,7 +102,7 @@ func main() {
105102

106103
firehoseConfig := &firehoseclient.FirehoseConfig{
107104
TrafficControllerURL: cfClient.Endpoint.DopplerEndpoint,
108-
InsecureSSLSkipVerify: *skipSSLValidation,
105+
InsecureSSLSkipVerify: true,
109106
IdleTimeoutSeconds: keepAlive,
110107
FirehoseSubscriptionID: *subscriptionId,
111108
}

manifest.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
applications:
22
- name: firehose-to-sumologic
33
env:
4-
API_ENDPOINT: https://api.bosh-lite.com
5-
DEBUG: false
6-
DOPPLER_ENDPOINT: wss://doppler.bosh-lite.com:443
7-
EVENTS: LogMessage,ValueMetric,Error,ContainerMetric
8-
FIREHOSE_USER: firehose_user
9-
FIREHOSE_PASSWORD: firehose_admin
104
FIREHOSE_SUBSCRIPTION_ID: firehose-to-sumologic
11-
LOG_EVENT_TOTALS: true
12-
LOG_EVENT_TOTALS_TIME: 10s
13-
SKIP_SSL_VALIDATION: true
14-
SYSLOG_ENDPOINT: 10.0.0.218:5514
5+
LOG_EVENTS_BATCHSIZE: 200
6+
SUMO_POST_MINIMUM_DELAY: 200ms

resources/sumo_128x128-B.png

1.38 KB
Loading

0 commit comments

Comments
 (0)