|
1 | | -// Before publishing your new repository: |
2 | | -// 1. Write the readme file |
3 | | -// 2. Update the issues link in Contributing section in the readme file |
4 | | -// 3. Update the discussion link in config.yml file in .github/ISSUE_TEMPLATE directory |
5 | | - |
6 | | -= repo-template |
7 | | - |
8 | | -// Add a short description of your project. Tell what your project does and what it's used for. |
9 | | - |
10 | | -This is a template repository for Teragrep organization. |
| 1 | += Java Record Routing Library |
11 | 2 |
|
12 | 3 | == Features |
13 | 4 |
|
14 | | -// List your project's features |
| 5 | +- Host+Tag based routing: CFE07Routing |
| 6 | +- Host+Tag based index and sourcetype enrichment: CFE12Routing |
| 7 | +- Authentication Token based Host+Tag information enrichment: CFE16Routing |
| 8 | +- Account ID + LogGroup based Host+Tag information enrichment: KIN02Routing |
| 9 | + |
| 10 | +== Examples |
15 | 11 |
|
16 | | -== Documentation |
| 12 | +=== CFE07Routing |
17 | 13 |
|
18 | | -See the official documentation on https://docs.teragrep.com[docs.teragrep.com]. |
| 14 | +[source, java] |
| 15 | +-- |
| 16 | +CFE07Routing cfe07Routing = new CFE07Routing("src/test/resources/cfe_07"); |
19 | 17 |
|
20 | | -== Limitations |
| 18 | +RoutingKey key = new RoutingKey("group-one-host-one", "group-one-tag-two"); |
21 | 19 |
|
22 | | -// If your project has limitations, please list them. Otherwise remove this section. |
| 20 | +for (String target : cfe07Routing.getTargets(key)) { |
| 21 | + // spool target |
| 22 | + if ("spool".equals(target)) { |
| 23 | + // do spool stuff |
| 24 | + } |
| 25 | +} |
23 | 26 |
|
24 | | -== How to [compile/use/implement] |
| 27 | +-- |
25 | 28 |
|
26 | | -// add instructions how people can start to use your project |
| 29 | +=== CFE12Routing |
27 | 30 |
|
28 | | -== Contributing |
| 31 | +[source, java] |
| 32 | +-- |
| 33 | +CFE12Routing cfe12Routing = new CFE12Routing("src/test/resources/cfe_12"); |
29 | 34 |
|
30 | | -// Change the repository name in the issues link to match with your project's name |
| 35 | +RoutingKey key = new RoutingKey("example-host", "124f76f0-net"); |
31 | 36 |
|
32 | | -You can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request. |
| 37 | +for (String index : cfe12Routing.getIndexes(key)) { |
| 38 | + for (String sourcetype : cfe12Routing.getSourcetypes(key)) { |
| 39 | + // do stuff for each index and for each sourcetype |
| 40 | + } |
| 41 | +} |
| 42 | +-- |
33 | 43 |
|
34 | | -Contribution requirements: |
| 44 | +=== CFE16Routing |
35 | 45 |
|
36 | | -. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so. |
37 | | -. Security checks must pass |
38 | | -. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming. |
39 | | -. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO). |
| 46 | +[source, java] |
| 47 | +-- |
| 48 | +CFE16Routing cfe16Routing = new CFE16Routing("src/test/resources/cfe_16"); |
| 49 | +RoutingKey key = cfe16Routing.getRoutingKey("My RoutingKey having token"); |
40 | 50 |
|
41 | | -Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline]. |
| 51 | +String hostname = key.getHostname(); |
| 52 | +String appName = key.getAppName(); |
| 53 | +-- |
42 | 54 |
|
43 | | -=== Contributor License Agreement |
| 55 | +=== KIN02Routing |
44 | 56 |
|
45 | | -Contributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories. |
| 57 | +[source, java] |
| 58 | +-- |
| 59 | +KIN02Routing kin02Routing = new KIN02Routing("src/test/resources/kin_02"); |
| 60 | +RoutingKey key = kin02Routing.getRoutingKey("1234567890","/example/logGroupName/ThatExists"); |
46 | 61 |
|
47 | | -You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories. |
| 62 | +String hostname key.getHostname(); |
| 63 | +String appName = key.getAppName(); |
| 64 | +-- |
0 commit comments