Skip to content

Commit a368f38

Browse files
committed
SCFF-44 added Readme.md file with instructions asked
1 parent 0c24070 commit a368f38

2 files changed

Lines changed: 80 additions & 22 deletions

File tree

README.md

Lines changed: 78 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,87 @@
1-
# README #
1+
# cloudfoundry-sumologic-nozzle
22

3-
This README would normally document whatever steps are necessary to get your application up and running.
3+
This Nozzle aggregates all the events from the _Firehose_ feature in Cloud Foundry towards Sumo Logic
44

5-
### What is this repository for? ###
5+
## Getting Started
66

7-
* Quick summary
8-
* Version
9-
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
7+
### Options of use
108

11-
### How do I get set up? ###
9+
```
10+
usage: main [<flags>]
1211
13-
* Summary of set up
14-
* Configuration
15-
* Dependencies
16-
* Database configuration
17-
* How to run tests
18-
* Deployment instructions
12+
Flags:
13+
--help Show context-sensitive help (also try --help-long and --help-man).
14+
--api-endpoint=API-ENDPOINT CF API Endpoint
15+
--sumo-endpoint=SUMO-ENDPOINT Sumo Logic Endpoint
16+
--subscription-id="firehose" Cloud Foundry ID for the subscription.
17+
--cloudfoundry-user=CLOUDFOUNDRY-USER
18+
Cloud Foundry User
19+
--cloudfoundry-password=CLOUDFOUNDRY-PASSWORD
20+
Cloud Foundry Password
21+
--events="LogMessage" Comma separated list of events you would like. Valid options are ContainerMetric, CounterEvent, Error, HttpStart,HttpStartStop, HttpStop, LogMessage, ValueMetric
22+
--nozzle-polling-period=15s Nozzle Polling Period
23+
--log-events-batch-size=LOG-EVENTS-BATCH-SIZE
24+
Log Events Batch Size
25+
--sumo-post-minimum-delay=SUMO-POST-MINIMUM-DELAY
26+
Sumo Logic HTTP Post Minimum Delay
27+
--sumo-category="" Sumo Logic Category
28+
--sumo-name="" Sumo Logic Name
29+
--sumo-host="" Sumo Logic Host
30+
--verbose-log-messages Allow Verbose Log Messages
31+
--custom-metadata="" Custom Metadata
32+
--version Show application version.
33+
```
1934

20-
### Contribution guidelines ###
35+
There are two ways to run this Nozzle:
2136

22-
* Writing tests
23-
* Code review
24-
* Other guidelines
37+
1. Run as standalone app
38+
2. Run as a tile in Pivotal Cloud Foundry
2539

26-
### Who do I talk to? ###
40+
### Run as standalone app
2741

28-
* Repo owner or admin
29-
* Other community or team contact
42+
```
43+
godep go run main.go --sumo-endpoint=https://sumo-endpoint --api-endpoint=https://api.endpoint --cloudfoundry-user=some_user --cloudfoundry-password=some_password --sumo-post-minimum-delay=200ms --custom-metadata=Key1:Value1,Key2:Value2,Key3:Value3 --log-events-batch-size=200 --events=LogMessage, ValueMetric --verbose-log-messages
44+
```
45+
46+
If everything goes right, you should see in your terminal the _Nozzle's Logs_ and, in the __Sumo Logic endpoint__ (defined in the _--sumo-endpoint_ flag) you should see the logs according the events you choose (_'LogMessage'_ and _'ValueMetric'_ with _verbose_ in this case).
47+
48+
### Run as a tile in Pivotal Cloud Foundry
49+
50+
**Pivotal Cloud Foundry** (PCF) has a Tile Generator tool which will help you to deploy this Nozzle in PCF allowing an easy configuration of it.
51+
52+
The tile configuration is handled in the 'tile.yml' file. (If you want to modify this file, is worth to mention that it is directly related to the Nozzle flags mentioned before).
53+
54+
#### Steps to run as this Nozzle as a tile in PCF:
55+
56+
##### Step 1 - Install the tile-generator python package
57+
58+
* Follow the Official Pivotal Instructions: http://docs.pivotal.io/tiledev/tile-generator.html#how-to
59+
(only until half of the _step 3_, DON'T DO 'tile init', only cd into the 'cloudfoundry-sumologic-nozzle' folder)
60+
61+
##### Step 2 - Check the tile file
62+
* If you want to add more settings to the tile or remove some. Check the Official Pivotal Documentation for more options http://docs.pivotal.io/tiledev/tile-generator.html#define
63+
64+
##### Step 3 - Prepare your code:
65+
* Zip your entire code and place the zip file into the root directory of the project for which you wish to create a tile. For this tile use this command: (you should do this in a new terminal window)
66+
67+
```
68+
zip -r sumo-logic-nozzle.zip bitbucket-pipelines.yml caching/ ci/ eventQueue/ eventRouting/ events/ firehoseclient/ glide.yaml glide.lock Godeps/ LICENSE logging/ main.go manifest.yml event.db Procfile sumoCFFirehose/ utils/ vendor/
69+
```
70+
##### Step 4 - Build tile file
71+
* go to the 'tile-generator' terminal window and run
72+
73+
```
74+
$ tile build
75+
```
76+
##### Step 4 - Install the tile in Pivotal Cloud Foundry
77+
* Login with proper credentials into the OPS Manager and import the .pivotal file created above and wait.
78+
* Then add it to the Installation Dashboard to configure it. You should able to configure the settings created in the tile file.
79+
* Update the changes and you should start to see some logs in the Sumo Logic Endpoint defined.
80+
81+
## Authors
82+
83+
mcplusa.com
84+
85+
## Related Sources
86+
87+
* Firehose-to-syslog Nozzle

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ var (
2525
user = kingpin.Flag("cloudfoundry-user", "Cloud Foundry User").OverrideDefaultFromEnvar("CLOUDFOUNDRY_USER").String() //user created in CF, authorized to connect the firehose
2626
password = kingpin.Flag("cloudfoundry-password", "Cloud Foundry 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()
2727
keepAlive, errK = time.ParseDuration("25s") //default Error, ContainerMetric, HttpStart, HttpStop, HttpStartStop, LogMessage, ValueMetric, CounterEvent
28-
wantedEvents = kingpin.Flag("events", fmt.Sprintf("Comma separated list of events you would like. Valid options are %s", eventRouting.GetListAuthorizedEventEvents())).Default("Error, ContainerMetric, HttpStart, HttpStop, HttpStartStop, LogMessage, ValueMetric, CounterEvent").OverrideDefaultFromEnvar("EVENTS").String()
28+
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()
2929
boltDatabasePath = "event.db"
3030
tickerTime = kingpin.Flag("nozzle-polling-period", "Nozzle Polling Period").Default("15s").OverrideDefaultFromEnvar("NOZZLE_POLLING_PERIOD").Duration()
3131
eventsBatchSize = kingpin.Flag("log-events-batch-size", "Log Events Batch Size").OverrideDefaultFromEnvar("LOG_EVENTS_BATCH_SIZE").Int()
3232
sumoPostMinimumDelay = kingpin.Flag("sumo-post-minimum-delay", "Sumo Logic HTTP Post Minimum Delay").OverrideDefaultFromEnvar("SUMO_POST_MINIMUM_DELAY").Duration()
3333
sumoCategory = kingpin.Flag("sumo-category", "Sumo Logic Category").Default("").OverrideDefaultFromEnvar("SUMO_CATEGORY").String()
3434
sumoName = kingpin.Flag("sumo-name", "Sumo Logic Name").Default("").OverrideDefaultFromEnvar("SUMO_NAME").String()
3535
sumoHost = kingpin.Flag("sumo-host", "Sumo Logic Host").Default("").OverrideDefaultFromEnvar("SUMO_HOST").String()
36-
verboseLogMessages = kingpin.Flag("verbose-log-messages", "Verbose Log Messages").Default("true").OverrideDefaultFromEnvar("VERBOSE_LOG_MESSAGES").Bool()
36+
verboseLogMessages = kingpin.Flag("verbose-log-messages", "Allow Verbose Log Messages").Default("false").OverrideDefaultFromEnvar("VERBOSE_LOG_MESSAGES").Bool()
3737
customMetadata = kingpin.Flag("custom-metadata", "Custom Metadata").Default("").OverrideDefaultFromEnvar("CUSTOM_METADATA").String()
3838
)
3939

0 commit comments

Comments
 (0)