|
1 | | -# README # |
| 1 | +# cloudfoundry-sumologic-nozzle |
2 | 2 |
|
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 |
4 | 4 |
|
5 | | -### What is this repository for? ### |
| 5 | +## Getting Started |
6 | 6 |
|
7 | | -* Quick summary |
8 | | -* Version |
9 | | -* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo) |
| 7 | +### Options of use |
10 | 8 |
|
11 | | -### How do I get set up? ### |
| 9 | +``` |
| 10 | +usage: main [<flags>] |
12 | 11 |
|
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 | +``` |
19 | 34 |
|
20 | | -### Contribution guidelines ### |
| 35 | +There are two ways to run this Nozzle: |
21 | 36 |
|
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 |
25 | 39 |
|
26 | | -### Who do I talk to? ### |
| 40 | +### Run as standalone app |
27 | 41 |
|
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 |
0 commit comments