From c49958ace7cb41d47cb43f7f4504dbe41017ff1e Mon Sep 17 00:00:00 2001 From: Strongest Number 9 <16169054+StrongestNumber9@users.noreply.github.com> Date: Wed, 17 Apr 2024 13:29:39 +0300 Subject: [PATCH] Initial release (#1) * Initial release --- .github/workflows/ci.yaml | 51 + .github/workflows/upload_release.yaml | 51 + .gitignore | 11 + LICENSE | 30 +- README.adoc | 75 +- eclipse-java-formatter.xml | 450 +++++++ license-header | 45 + pom.xml | 354 ++++++ .../teragrep/rlo_11/cfe_07/CFE07Routing.java | 83 ++ .../com/teragrep/rlo_11/cfe_07/LogGroup.java | 76 ++ .../rlo_11/cfe_07/LogGroupProcessor.java | 149 +++ .../rlo_11/cfe_07/LogGroupSearch.java | 73 ++ .../teragrep/rlo_11/cfe_12/CFE12Routing.java | 105 ++ .../com/teragrep/rlo_11/cfe_12/LogGroup.java | 90 ++ .../rlo_11/cfe_12/LogGroupProcessor.java | 153 +++ .../rlo_11/cfe_12/LogGroupSearch.java | 73 ++ .../teragrep/rlo_11/cfe_16/CFE16Routing.java | 104 ++ .../java/com/teragrep/rlo_11/key/AppName.java | 111 ++ .../com/teragrep/rlo_11/key/Hostname.java | 99 ++ .../com/teragrep/rlo_11/key/Validatable.java | 51 + .../teragrep/rlo_11/kin_02/KIN02Routing.java | 110 ++ .../rlo_11/cfe_07/CFE07RoutingTest.java | 71 ++ .../rlo_11/cfe_12/CFE12RoutingTest.java | 68 ++ .../rlo_11/cfe_12/LogGroupProcessorTest.java | 87 ++ .../rlo_11/cfe_12/LogGroupSearchTest.java | 77 ++ .../rlo_11/cfe_16/CFE16RoutingTest.java | 83 ++ .../teragrep/rlo_11/key/RoutingKeyTest.java | 106 ++ .../rlo_11/kin_02/KIN02RoutingTest.java | 100 ++ src/test/resources/cfe_07/es_hosts.json | 11 + src/test/resources/cfe_07/es_target_es.json | 11 + .../resources/cfe_07/group-one_hosts.json | 15 + .../cfe_07/group-one_target_spool.json | 23 + .../resources/cfe_07/group-two_hosts.json | 15 + .../cfe_07/group-two_target_spool.json | 23 + src/test/resources/cfe_12/group-10_hosts.json | 991 ++++++++++++++++ .../resources/cfe_12/group-10_indexes.json | 43 + .../cfe_12/group-10_sourcetypes.json | 43 + src/test/resources/cfe_12/group-11_hosts.json | 991 ++++++++++++++++ .../resources/cfe_12/group-11_indexes.json | 43 + .../cfe_12/group-11_sourcetypes.json | 43 + src/test/resources/cfe_12/group-12_hosts.json | 991 ++++++++++++++++ .../resources/cfe_12/group-12_indexes.json | 43 + .../cfe_12/group-12_sourcetypes.json | 43 + src/test/resources/cfe_12/group-13_hosts.json | 991 ++++++++++++++++ .../resources/cfe_12/group-13_indexes.json | 43 + .../cfe_12/group-13_sourcetypes.json | 43 + src/test/resources/cfe_12/group-14_hosts.json | 71 ++ .../resources/cfe_12/group-14_indexes.json | 43 + .../cfe_12/group-14_sourcetypes.json | 43 + .../resources/cfe_12/test-data_hosts.json | 1031 +++++++++++++++++ .../resources/cfe_12/test-data_indexes.json | 39 + .../cfe_12/test-data_sourcetypes.json | 39 + src/test/resources/cfe_16/hec_hosts.json | 11 + .../kin_02/stream-processor_hosts.json | 11 + .../kin_02/stream-processor_tags.json | 11 + 55 files changed, 8610 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/upload_release.yaml create mode 100644 .gitignore create mode 100644 eclipse-java-formatter.xml create mode 100644 license-header create mode 100644 pom.xml create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_07/CFE07Routing.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_07/LogGroup.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupProcessor.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupSearch.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_12/CFE12Routing.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_12/LogGroup.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessor.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupSearch.java create mode 100644 src/main/java/com/teragrep/rlo_11/cfe_16/CFE16Routing.java create mode 100644 src/main/java/com/teragrep/rlo_11/key/AppName.java create mode 100644 src/main/java/com/teragrep/rlo_11/key/Hostname.java create mode 100644 src/main/java/com/teragrep/rlo_11/key/Validatable.java create mode 100644 src/main/java/com/teragrep/rlo_11/kin_02/KIN02Routing.java create mode 100644 src/test/java/com/teragrep/rlo_11/cfe_07/CFE07RoutingTest.java create mode 100644 src/test/java/com/teragrep/rlo_11/cfe_12/CFE12RoutingTest.java create mode 100644 src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessorTest.java create mode 100644 src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupSearchTest.java create mode 100644 src/test/java/com/teragrep/rlo_11/cfe_16/CFE16RoutingTest.java create mode 100644 src/test/java/com/teragrep/rlo_11/key/RoutingKeyTest.java create mode 100644 src/test/java/com/teragrep/rlo_11/kin_02/KIN02RoutingTest.java create mode 100644 src/test/resources/cfe_07/es_hosts.json create mode 100644 src/test/resources/cfe_07/es_target_es.json create mode 100644 src/test/resources/cfe_07/group-one_hosts.json create mode 100644 src/test/resources/cfe_07/group-one_target_spool.json create mode 100644 src/test/resources/cfe_07/group-two_hosts.json create mode 100644 src/test/resources/cfe_07/group-two_target_spool.json create mode 100644 src/test/resources/cfe_12/group-10_hosts.json create mode 100644 src/test/resources/cfe_12/group-10_indexes.json create mode 100644 src/test/resources/cfe_12/group-10_sourcetypes.json create mode 100644 src/test/resources/cfe_12/group-11_hosts.json create mode 100644 src/test/resources/cfe_12/group-11_indexes.json create mode 100644 src/test/resources/cfe_12/group-11_sourcetypes.json create mode 100644 src/test/resources/cfe_12/group-12_hosts.json create mode 100644 src/test/resources/cfe_12/group-12_indexes.json create mode 100644 src/test/resources/cfe_12/group-12_sourcetypes.json create mode 100644 src/test/resources/cfe_12/group-13_hosts.json create mode 100644 src/test/resources/cfe_12/group-13_indexes.json create mode 100644 src/test/resources/cfe_12/group-13_sourcetypes.json create mode 100644 src/test/resources/cfe_12/group-14_hosts.json create mode 100644 src/test/resources/cfe_12/group-14_indexes.json create mode 100644 src/test/resources/cfe_12/group-14_sourcetypes.json create mode 100644 src/test/resources/cfe_12/test-data_hosts.json create mode 100644 src/test/resources/cfe_12/test-data_indexes.json create mode 100644 src/test/resources/cfe_12/test-data_sourcetypes.json create mode 100644 src/test/resources/cfe_16/hec_hosts.json create mode 100644 src/test/resources/kin_02/stream-processor_hosts.json create mode 100644 src/test/resources/kin_02/stream-processor_tags.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..92a6424 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,51 @@ +name: CI + +on: push + +jobs: + verify: + name: Verify Code + runs-on: ubuntu-latest + + env: + COVERITY: coverity_tool + + steps: + - uses: actions/checkout@v2 + + - name: Setup Maven Central + uses: actions/setup-java@v2 + with: + java-version: 8.0.292+10 + distribution: 'adopt' + + - name: Cache Local Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + + - name: Compile Test and Verify + run: mvn --batch-mode clean verify + + - name: Cache Coverity + id: cache_coverity + uses: actions/cache@v2 + with: + path: ${{ env.COVERITY }} + key: coverity + + - name: Download Coverity + if: steps.cache_coverity.outputs.cache-hit != 'true' + run: | + wget --quiet https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_TOKEN }}&project=rlo_11" -O ${{ env.COVERITY }}.tgz + mkdir -p ${{ env.COVERITY }} + tar zxvf ${{ env.COVERITY }}.tgz -C ${{ env.COVERITY }} --strip-components 1 + + - name: Compile Coverity + run: | + ${{ env.COVERITY }}/bin/cov-build --dir cov-int mvn -DskipTests=true --batch-mode clean compile + tar czvf rlo_11.tgz cov-int + + - name: Upload to Coverity + run: curl --silent --form token=${{ secrets.COVERITY_TOKEN }} --form email=${{ secrets.COVERITY_EMAIL }} --form file=@rlo_11.tgz --form version="${GITHUB_REF##*/}" --form description="automated upload" https://scan.coverity.com/builds?project=rlo_11 diff --git a/.github/workflows/upload_release.yaml b/.github/workflows/upload_release.yaml new file mode 100644 index 0000000..44b8dc0 --- /dev/null +++ b/.github/workflows/upload_release.yaml @@ -0,0 +1,51 @@ +name: Upload Release + +on: + release: + types: published + +jobs: + upload: + name: Upload + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Cache Local Maven Repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + + - name: Setup Maven Central + uses: actions/setup-java@v2 + with: + java-version: 8.0.292+10 + distribution: 'adopt' + + server-id: ossrh + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + - name: Publish to Maven Central + run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-maven-central + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} + + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + - name: Setup GitHub Packages + uses: actions/setup-java@v2 + with: + java-version: 8.0.292+10 + distribution: 'adopt' + + - name: Publish to GitHub Packages + run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eb7f1c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +target/* +/target/ +.settings/* +.vscode/* +.classpath +.factorypath +.project +/dependency-reduced-pom.xml +.idea/** +*.iml +.flattened-pom.xml diff --git a/LICENSE b/LICENSE index 0ad25db..05587a3 100644 --- a/LICENSE +++ b/LICENSE @@ -633,8 +633,8 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -659,3 +659,29 @@ specific requirements. if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . + +Additional permission under GNU Affero General Public License version 3 +section 7 + +If you modify this Program, or any covered work, by linking or combining it with +other code, such other code is not for that reason alone subject to any of the +requirements of the GNU Affero GPL version 3 as long as this Program is the same +Program as licensed from Suomen Kanuuna Oy without any additional modifications. + +Supplemented terms under GNU Affero General Public License version 3 +section 7 + +Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified +versions must be marked as "Modified version of" The Program. + +Names of the licensors and authors may not be used for publicity purposes. + +No rights are granted for use of trade names, trademarks, or service marks +which are in The Program if any. + +Licensee must indemnify licensors and authors for any liability that these +contractual assumptions impose on licensors and authors. + +To the extent this program is licensed as part of the Commercial versions of +Teragrep, the applicable Commercial License may apply to this file if you as +a licensee so wish it. diff --git a/README.adoc b/README.adoc index 0f563cc..4b94fce 100644 --- a/README.adoc +++ b/README.adoc @@ -1,47 +1,64 @@ -// Before publishing your new repository: -// 1. Write the readme file -// 2. Update the issues link in Contributing section in the readme file -// 3. Update the discussion link in config.yml file in .github/ISSUE_TEMPLATE directory - -= repo-template - -// Add a short description of your project. Tell what your project does and what it's used for. - -This is a template repository for Teragrep organization. += Java Record Routing Library == Features -// List your project's features +- Host+Tag based routing: CFE07Routing +- Host+Tag based index and sourcetype enrichment: CFE12Routing +- Authentication Token based Host+Tag information enrichment: CFE16Routing +- Account ID + LogGroup based Host+Tag information enrichment: KIN02Routing + +== Examples -== Documentation +=== CFE07Routing -See the official documentation on https://docs.teragrep.com[docs.teragrep.com]. +[source, java] +-- +CFE07Routing cfe07Routing = new CFE07Routing("src/test/resources/cfe_07"); -== Limitations +RoutingKey key = new RoutingKey("group-one-host-one", "group-one-tag-two"); -// If your project has limitations, please list them. Otherwise remove this section. +for (String target : cfe07Routing.getTargets(key)) { + // spool target + if ("spool".equals(target)) { + // do spool stuff + } +} -== How to [compile/use/implement] +-- -// add instructions how people can start to use your project +=== CFE12Routing -== Contributing +[source, java] +-- +CFE12Routing cfe12Routing = new CFE12Routing("src/test/resources/cfe_12"); -// Change the repository name in the issues link to match with your project's name +RoutingKey key = new RoutingKey("example-host", "124f76f0-net"); -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. +for (String index : cfe12Routing.getIndexes(key)) { + for (String sourcetype : cfe12Routing.getSourcetypes(key)) { + // do stuff for each index and for each sourcetype + } +} +-- -Contribution requirements: +=== CFE16Routing -. *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. -. Security checks must pass -. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming. -. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO). +[source, java] +-- +CFE16Routing cfe16Routing = new CFE16Routing("src/test/resources/cfe_16"); +RoutingKey key = cfe16Routing.getRoutingKey("My RoutingKey having token"); -Read more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline]. +String hostname = key.getHostname(); +String appName = key.getAppName(); +-- -=== Contributor License Agreement +=== KIN02Routing -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. +[source, java] +-- +KIN02Routing kin02Routing = new KIN02Routing("src/test/resources/kin_02"); +RoutingKey key = kin02Routing.getRoutingKey("1234567890","/example/logGroupName/ThatExists"); -You need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories. +String hostname key.getHostname(); +String appName = key.getAppName(); +-- diff --git a/eclipse-java-formatter.xml b/eclipse-java-formatter.xml new file mode 100644 index 0000000..53b9f2a --- /dev/null +++ b/eclipse-java-formatter.xml @@ -0,0 +1,450 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/license-header b/license-header new file mode 100644 index 0000000..73c948e --- /dev/null +++ b/license-header @@ -0,0 +1,45 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..be5a6be --- /dev/null +++ b/pom.xml @@ -0,0 +1,354 @@ + + + 4.0.0 + com.teragrep + rlo_11 + ${revision}${sha1}${changelist} + jar + rlo_11 + Java Record Routing Library + https://teragrep.com + + + GNU Affero General Public License v3.0 + https://www.gnu.org/licenses/agpl-3.0.txt + + + + + Mikko Kortelainen + 1@teragrep.com + Teragrep + https://teragrep.com + + + + scm:git:https://github.com/teragrep/rlo_11.git + scm:git:git@github.com:teragrep/rlo_11.git + https://github.com/teragrep/rlo_11/tree/master + + + -SNAPSHOT + 1.8 + UTF-8 + 0.0.1 + + + + + + com.google.code.gson + gson + 2.8.9 + + + + com.teragrep + jlt_01 + 1.0.1 + + + + org.slf4j + slf4j-api + 2.0.6 + + + org.slf4j + slf4j-simple + 2.0.6 + test + + + + org.junit.jupiter + junit-jupiter-engine + 5.7.1 + test + + + org.junit.platform + junit-platform-launcher + 1.7.1 + test + + + org.junit.jupiter + junit-jupiter-api + 5.7.1 + test + + + + ${project.basedir}/target + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.4.1 + + + enforce-maven + + enforce + + + + + 3.2.5 + + + + + + enforce + none + + + + + com.diffplug.spotless + spotless-maven-plugin + + 2.30.0 + + + + ${project.basedir}/eclipse-java-formatter.xml + 4.10.0 + + + + ${project.basedir}/license-header + + + + + + UTF-8 + \n + true + false + 2 + recommended_2008_06 + true + true + true + + + + + + .gitattributes + .gitignore + + + + + true + 4 + + + + + + + + check + + compile + + + + + org.apache.rat + apache-rat-plugin + 0.16.1 + false + + false + false + + + Teragrep + GNU AFFERO GENERAL PUBLIC LICENSE + + + + + + + Suomen Kanuuna Oy + 2024 + + Java Record Routing Library RLO-11 + + Teragrep + + + true + false + + + .git/** + .gitattributes + .gitignore + .gitmodules + + .github/workflows/* + .github/ISSUE_TEMPLATE/* + toolchains.xml + settings.xml + + rpm/rpm.pom.xml + pom.xml + eclipse-java-formatter.xml + license-header + + rpm/src/main/resources/** + src/test/resources/** + + rpm/pom.xml + + Dockerfile + + README.adoc + + + + + + check + + test + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.12.1 + + 8 + 8 + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.2.5 + + all + true + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.1 + + true + + + + org.codehaus.mojo + flatten-maven-plugin + 1.4.1 + + true + resolveCiFriendliesOnly + + + + flatten.clean + + clean + + clean + + + flatten + + flatten + + process-resources + + + + + + + + publish-maven-central + + + ossrh + Central Repository OSSRH + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + + sign + + verify + + + --pinentry-mode + loopback + + + + + + + + + + publish-github-packages + + + github + GitHub Packages + https://maven.pkg.github.com/teragrep/rlo_11 + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + + sign + + verify + + + --pinentry-mode + loopback + + + + + + + + + + diff --git a/src/main/java/com/teragrep/rlo_11/cfe_07/CFE07Routing.java b/src/main/java/com/teragrep/rlo_11/cfe_07/CFE07Routing.java new file mode 100644 index 0000000..566b8c8 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_07/CFE07Routing.java @@ -0,0 +1,83 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_07; + +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; + +import java.io.IOException; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.Set; + +public class CFE07Routing { + + private final LinkedList logGroupList; + + public CFE07Routing(String lookupPath, Set targetSet) throws IOException { + final LogGroupProcessor logGroupProcessor = new LogGroupProcessor(targetSet); + this.logGroupList = logGroupProcessor.load(lookupPath); + } + + public Set getTargets(Hostname hostname, AppName appName) { + + // check hostname + if (!hostname.validate()) { + throw new IllegalArgumentException("Unable to route invalid hostname"); + } + + // check appName + if (!appName.validate()) { + throw new IllegalArgumentException("Unable to route invalid appName"); + } + + Set targetSet = new HashSet<>(); + for (LogGroup logGroup : logGroupList) { + targetSet.addAll(logGroup.getTargets(hostname.hostname, appName.appName)); + } + return targetSet; + } +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroup.java b/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroup.java new file mode 100644 index 0000000..ca28980 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroup.java @@ -0,0 +1,76 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_07; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + +public class LogGroup { + + private final String name; + private final Set hosts; + private final HashMap> targetTags; + + public LogGroup(String group, Set hosts, HashMap> targetTags) { + this.name = group; + this.hosts = hosts; + this.targetTags = targetTags; + } + + public Set getTargets(String host, String tag) { + Set targetSet = new HashSet<>(); + if (hosts.contains(host)) { + for (String target : targetTags.keySet()) { + if (targetTags.get(target).contains(tag)) { + targetSet.add(target); + } + } + } + + return targetSet; + } +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupProcessor.java b/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupProcessor.java new file mode 100644 index 0000000..97149e3 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupProcessor.java @@ -0,0 +1,149 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_07; + +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; +import com.teragrep.jlt_01.pojo.JsonStringLookupTable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.*; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; + +public class LogGroupProcessor { + + private static final Logger LOGGER = LoggerFactory.getLogger(LogGroupProcessor.class); + + private final Gson gson; + private final Set targetSet; + + public LogGroupProcessor(Set targetSet) { + this.gson = new Gson(); + this.targetSet = targetSet; + } + + public LinkedList load(String path) throws IOException { + final LinkedList logGroupList = new LinkedList<>(); + Set groups; + + try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(path))) { + LogGroupSearch groupSearch = new LogGroupSearch(stream); + groups = groupSearch.getGroupList(); + } + + LOGGER.debug("Found log group names <[{}]>", groups); + + if (groups != null && !groups.isEmpty()) { + for (String group : groups) { + // read hosts for the Group + final Set hosts = loadHostsFile(path, group); + + HashMap> targetTags = new HashMap<>(); + for (String target : targetSet) { + final Set tags = loadFile(path, group, target); + targetTags.put(target, tags); + } + + logGroupList.add(new LogGroup(group, hosts, targetTags)); + } + } + + LOGGER.debug("Loaded log group list <[{}]>", logGroupList); + + return logGroupList; + } + + private Set loadFile(String path, String group, String type) throws IOException { + final Set groupEnabled = new HashSet<>(); + File file = new File(path + "/" + group + "_target_" + type + ".json"); + try (FileReader fileReader = new FileReader(file)) { + try (BufferedReader bufferedReader = new BufferedReader(fileReader)) { + JsonStringLookupTable groupTable; + try { + groupTable = gson.fromJson(bufferedReader, JsonStringLookupTable.class); + } + catch (JsonSyntaxException e) { + LOGGER.error("Can't parse file <[{}]>: ", file.getAbsolutePath(), e); + throw new JsonSyntaxException(e); + } + for (int i = 0; i < groupTable.getTable().size(); i++) { + if ("true".equals(groupTable.getTable().get(i).getValue())) + groupEnabled.add(groupTable.getTable().get(i).getIndex()); + } + } + + } + catch (FileNotFoundException fileNotFoundException) { + LOGGER + .warn( + "Skipped group <[{}]> target <{}> due to exception: {}", group, type, + fileNotFoundException.getMessage() + ); + } + + return groupEnabled; + } + + private Set loadHostsFile(String path, String group) throws IOException { + try (FileReader fileReader = new FileReader(path + "/" + group + "_hosts.json")) { + try (BufferedReader hostReader = new BufferedReader(fileReader)) { + JsonStringLookupTable hostsTable = gson.fromJson(hostReader, JsonStringLookupTable.class); + + final Set groupHosts = new HashSet<>(); + for (int i = 0; i < hostsTable.getTable().size(); i++) { + if ("true".equals(hostsTable.getTable().get(i).getValue())) + groupHosts.add(hostsTable.getTable().get(i).getIndex()); + } + return groupHosts; + } + } + } +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupSearch.java b/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupSearch.java new file mode 100644 index 0000000..daadd9c --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_07/LogGroupSearch.java @@ -0,0 +1,73 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_07; + +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; + +public final class LogGroupSearch { + + final Set groupList; + + public LogGroupSearch(DirectoryStream stream) { + this.groupList = new HashSet<>(); + + for (Path path : stream) { + if (!Files.isDirectory(path)) { + groupList + .add(path.getFileName().toString().replaceAll("_hosts\\.json$", "").replaceAll("_target_.*\\.json$", "")); + } + } + } + + public Set getGroupList() { + return this.groupList; + } + +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_12/CFE12Routing.java b/src/main/java/com/teragrep/rlo_11/cfe_12/CFE12Routing.java new file mode 100644 index 0000000..a0ff611 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_12/CFE12Routing.java @@ -0,0 +1,105 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; + +import java.io.IOException; +import java.util.HashSet; +import java.util.LinkedList; + +public class CFE12Routing { + /* + */ + + private final LinkedList logGroupList; + + public CFE12Routing(String lookupPath) throws IOException { + final LogGroupProcessor logGroupProcessor = new LogGroupProcessor(); + this.logGroupList = logGroupProcessor.load(lookupPath); + + } + + public HashSet getIndexes(Hostname hostname, AppName appName) { + if (!hostname.validate()) { + throw new IllegalArgumentException("Unable to getIndexes for invalid hostname"); + } + + if (!appName.validate()) { + throw new IllegalArgumentException("Unable to getIndexes for invalid appName"); + } + + final HashSet indexes = new HashSet<>(); + // CFE-12 lookups have no way to determine all groups for host, iterating all + for (LogGroup group : logGroupList) { + final String index = group.getIndex(hostname.hostname, appName.appName); + if (index != null) { + indexes.add(index); + } + } + return indexes; + } + + public HashSet getSourcetypes(Hostname hostname, AppName appName) { + if (!hostname.validate()) { + throw new IllegalArgumentException("Unable to getSourcetypes for invalid hostname"); + } + + if (!appName.validate()) { + throw new IllegalArgumentException("Unable to getSourcetypes for invalid appName"); + } + + final HashSet sourcetypes = new HashSet<>(); + for (LogGroup group : logGroupList) { + final String sourcetype = group.getSourcetype(hostname.hostname, appName.appName); + if (sourcetype != null) { + sourcetypes.add(sourcetype); + } + } + return sourcetypes; + } +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroup.java b/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroup.java new file mode 100644 index 0000000..c0bfeb2 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroup.java @@ -0,0 +1,90 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Set; + +public final class LogGroup { + + private final String name; + private final Set hosts; + private final HashMap tag2index; + private final HashMap tag2sourcetype; + + public LogGroup( + String name, + Set hosts, + HashMap tag2index, + HashMap tag2sourcetype + ) { + this.name = name; + this.hosts = hosts; + this.tag2index = tag2index; + this.tag2sourcetype = tag2sourcetype; + } + + public String getIndex(String host, String tag) { + if (this.hosts.contains(host.toLowerCase(Locale.ROOT))) { + return this.tag2index.get(tag.toLowerCase(Locale.ROOT)); + } + return null; + } + + public String getSourcetype(String host, String tag) { + if (this.hosts.contains(host.toLowerCase(Locale.ROOT))) { + return this.tag2sourcetype.get(tag.toLowerCase(Locale.ROOT)); + } + return null; + } + + @Override + public String toString() { + return "LogGroup{" + "name='" + name + '\'' + ", hosts=" + hosts + ", tag2index=" + tag2index + + ", tag2sourcetype=" + tag2sourcetype + '}'; + } +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessor.java b/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessor.java new file mode 100644 index 0000000..121553d --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessor.java @@ -0,0 +1,153 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import com.google.gson.Gson; +import com.teragrep.jlt_01.pojo.JsonStringLookupTable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; + +public final class LogGroupProcessor { + + private static final Logger LOGGER = LoggerFactory.getLogger(LogGroupProcessor.class); + + final Gson gson; + + public LogGroupProcessor() { + this.gson = new Gson(); + } + + public LinkedList load(String path) throws IOException { + final LinkedList logGroupList = new LinkedList<>(); + Set groups; + + try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(path))) { + LogGroupSearch groupSearch = new LogGroupSearch(stream); + groups = groupSearch.getGroupList(); + + } + + LOGGER.debug("Found log group names <[{}]>", groups); + + if (groups != null && groups.size() > 0) { + + for (String group : groups) { + // read hosts for the Group + final Set hosts = loadHostsFile(path, group); + + // read indexes for the Group + final HashMap tag2index = loadIndexesFile(path, group); + + final HashMap tag2sourcetype = loadSourcetypesFile(path, group); + + logGroupList.add(new LogGroup(group, hosts, tag2index, tag2sourcetype)); + } + } + + LOGGER.debug("Loaded log group list <[{}]>", logGroupList); + + return logGroupList; + } + + private Set loadHostsFile(String path, String group) throws IOException { + try (FileReader fileReader = new FileReader(path + "/" + group + "_hosts.json")) { + try (BufferedReader hostReader = new BufferedReader(fileReader)) { + JsonStringLookupTable hostsTable = gson.fromJson(hostReader, JsonStringLookupTable.class); + + final Set groupHosts = new HashSet<>(); + for (int i = 0; i < hostsTable.getTable().size(); i++) { + if ("true".equals(hostsTable.getTable().get(i).getValue())) + groupHosts.add(hostsTable.getTable().get(i).getIndex().toLowerCase(Locale.ROOT)); + } + return groupHosts; + } + } + } + + private HashMap loadIndexesFile(String path, String group) throws IOException { + try (FileReader fileReader = new FileReader(path + "/" + group + "_indexes.json")) { + try (BufferedReader indexesReader = new BufferedReader(fileReader);) { + JsonStringLookupTable indexesTable = gson.fromJson(indexesReader, JsonStringLookupTable.class); + + final HashMap groupIndexes = new HashMap<>(); + for (int i = 0; i < indexesTable.getTable().size(); i++) { + groupIndexes + .put(indexesTable.getTable().get(i).getIndex().toLowerCase(Locale.ROOT), // tag + indexesTable.getTable().get(i).getValue().toLowerCase(Locale.ROOT) // index + ); + } + return groupIndexes; + } + } + } + + private HashMap loadSourcetypesFile(String path, String group) throws IOException { + try (FileReader fileReader = new FileReader(path + "/" + group + "_sourcetypes.json")) { + try (BufferedReader sourcetypesReader = new BufferedReader(fileReader)) { + JsonStringLookupTable sourcetypesTable = gson.fromJson(sourcetypesReader, JsonStringLookupTable.class); + + final HashMap groupSourcetypes = new HashMap<>(); + + for (int i = 0; i < sourcetypesTable.getTable().size(); i++) { + groupSourcetypes + .put(sourcetypesTable.getTable().get(i).getIndex().toLowerCase(Locale.ROOT), // tag + sourcetypesTable.getTable().get(i).getValue().toLowerCase(Locale.ROOT) // index + ); + } + return groupSourcetypes; + } + } + } +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupSearch.java b/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupSearch.java new file mode 100644 index 0000000..a1ff81a --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_12/LogGroupSearch.java @@ -0,0 +1,73 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.Set; + +public final class LogGroupSearch { + + final Set groupList; + + public LogGroupSearch(DirectoryStream stream) { + this.groupList = new HashSet<>(); + + for (Path path : stream) { + if (!Files.isDirectory(path)) { + groupList + .add(path.getFileName().toString().replaceAll("_hosts\\.json$", "").replaceAll("_indexes\\.json$", "").replaceAll("_sourcetypes\\.json$", "")); + } + } + } + + public Set getGroupList() { + return this.groupList; + } + +} diff --git a/src/main/java/com/teragrep/rlo_11/cfe_16/CFE16Routing.java b/src/main/java/com/teragrep/rlo_11/cfe_16/CFE16Routing.java new file mode 100644 index 0000000..3bc3b0f --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/cfe_16/CFE16Routing.java @@ -0,0 +1,104 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_16; + +import com.google.gson.Gson; +import com.teragrep.jlt_01.pojo.JsonStringLookupTable; +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +public class CFE16Routing { + // hec_hosts.json + /* + NOTE hec_tags.json is not used and must not be used see cfe_07/issue/56 + */ + + private final Map tokenToHostMap; + + public CFE16Routing(String lookupPath) throws IOException { + this.tokenToHostMap = loadHostsFile(lookupPath); + } + + public AppName getAppName(String authenticationToken) { + return new AppName("capsulated"); + } + + public Hostname getHostname(String authenticationToken) { + Hostname hostname; + if (tokenToHostMap.containsKey(authenticationToken)) { + hostname = new Hostname(tokenToHostMap.get(authenticationToken)); + } + else { + // return stub + hostname = new Hostname(); + } + return hostname; + } + + private Map loadHostsFile(String path) throws IOException { + final Gson gson = new Gson(); + + try (FileReader fileReader = new FileReader(path + "/hec_hosts.json")) { + try (BufferedReader hostReader = new BufferedReader(fileReader)) { + JsonStringLookupTable hostsTable = gson.fromJson(hostReader, JsonStringLookupTable.class); + + final Map tokenToHostMap = new HashMap<>(); + for (int i = 0; i < hostsTable.getTable().size(); i++) { + String token = hostsTable.getTable().get(i).getIndex(); + String hostname = hostsTable.getTable().get(i).getValue(); + tokenToHostMap.put(token, hostname); + } + return tokenToHostMap; + } + } + } +} diff --git a/src/main/java/com/teragrep/rlo_11/key/AppName.java b/src/main/java/com/teragrep/rlo_11/key/AppName.java new file mode 100644 index 0000000..85a7d4e --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/key/AppName.java @@ -0,0 +1,111 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.key; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class AppName implements Validatable { + + private static final Pattern appNamePattern = Pattern.compile("^([a-zA-Z0-9\\._\\-]+)"); + + public final String appName; + + public final boolean isStub; + + public AppName(String appName) { + this.appName = appName; + this.isStub = false; + } + + public AppName() { + this.appName = ""; + this.isStub = true; + } + + @Override + public boolean validate() { + if (isStub) { + throw new IllegalStateException("Unable to validate stub appName"); + } + + return !appName.startsWith(":") && !appName.startsWith("/") && !appName.startsWith("[") && !".".equals(appName) + && !"..".equals(appName); + } + + public AppName asCompatible() { + if (isStub) { + throw new IllegalStateException("Unable to produce compatible appName from a stub"); + } + + AppName rv; + Matcher appNameMatcher = appNamePattern.matcher(appName); + if (appNameMatcher.find()) { + rv = new AppName(appNameMatcher.group(0)); + } + else { + rv = new AppName(""); + } + + return rv; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + AppName appName1 = (AppName) o; + return Objects.equals(appName, appName1.appName); + } + + @Override + public int hashCode() { + return Objects.hash(appName); + } +} diff --git a/src/main/java/com/teragrep/rlo_11/key/Hostname.java b/src/main/java/com/teragrep/rlo_11/key/Hostname.java new file mode 100644 index 0000000..4a4d8d2 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/key/Hostname.java @@ -0,0 +1,99 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.key; + +import java.util.Objects; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Hostname implements Validatable { + + private static final Pattern hostnamePattern = Pattern.compile("^[a-zA-Z0-9\\.\\-]+$"); + + public final String hostname; + + public final boolean isStub; + + public Hostname(String hostname) { + this.hostname = hostname; + this.isStub = false; + } + + public Hostname() { + this.hostname = ""; + this.isStub = true; + } + + @Override + public boolean validate() { + if (isStub) { + throw new IllegalStateException("Unable to validate stub hostname"); + } + + boolean rv = false; + Matcher hostnameMatcher = hostnamePattern.matcher(hostname); + if (hostnameMatcher.matches()) { + rv = true; + } + + return rv; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Hostname hostname1 = (Hostname) o; + return isStub == hostname1.isStub && Objects.equals(hostname, hostname1.hostname); + } + + @Override + public int hashCode() { + return Objects.hash(hostname, isStub); + } +} diff --git a/src/main/java/com/teragrep/rlo_11/key/Validatable.java b/src/main/java/com/teragrep/rlo_11/key/Validatable.java new file mode 100644 index 0000000..a1d8391 --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/key/Validatable.java @@ -0,0 +1,51 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.key; + +public interface Validatable { + + boolean validate(); +} diff --git a/src/main/java/com/teragrep/rlo_11/kin_02/KIN02Routing.java b/src/main/java/com/teragrep/rlo_11/kin_02/KIN02Routing.java new file mode 100644 index 0000000..19f05bf --- /dev/null +++ b/src/main/java/com/teragrep/rlo_11/kin_02/KIN02Routing.java @@ -0,0 +1,110 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.kin_02; + +import com.google.gson.Gson; +import com.teragrep.jlt_01.pojo.JsonStringLookupTable; +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.util.HashMap; +import java.util.Map; + +public class KIN02Routing { + // stream-processor_hosts.json + // stream-processor_tags.json + + private final Gson gson = new Gson(); + + private final Map accountIdToHostnameMap; + private final Map logGroupToAppNameMap; + + public KIN02Routing(String lookupPath) throws FileNotFoundException { + this.accountIdToHostnameMap = loadFile(lookupPath, "hosts"); + this.logGroupToAppNameMap = loadFile(lookupPath, "tags"); + } + + public AppName getAppName(String logGroup) { + AppName appName; + if (logGroupToAppNameMap.containsKey(logGroup)) { + appName = new AppName(logGroupToAppNameMap.get(logGroup)).asCompatible(); + } + else { + // stub + appName = new AppName(); + } + return appName; + } + + public Hostname getHostname(String accountId) { + Hostname hostname; + if (accountIdToHostnameMap.containsKey(accountId)) { + hostname = new Hostname(accountIdToHostnameMap.get(accountId)); + } + else { + // stub + hostname = new Hostname(); + } + return hostname; + } + + private Map loadFile(String path, String type) throws FileNotFoundException { + + BufferedReader fileReader = new BufferedReader(new FileReader(path + "/stream-processor_" + type + ".json")); + JsonStringLookupTable typeTable = gson.fromJson(fileReader, JsonStringLookupTable.class); + + final Map typeMap = new HashMap<>(); + for (int i = 0; i < typeTable.getTable().size(); i++) { + String key = typeTable.getTable().get(i).getIndex(); + String value = typeTable.getTable().get(i).getValue(); + typeMap.put(key, value); + } + return typeMap; + } +} diff --git a/src/test/java/com/teragrep/rlo_11/cfe_07/CFE07RoutingTest.java b/src/test/java/com/teragrep/rlo_11/cfe_07/CFE07RoutingTest.java new file mode 100644 index 0000000..3941744 --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/cfe_07/CFE07RoutingTest.java @@ -0,0 +1,71 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_07; + +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +public class CFE07RoutingTest { + + @Test + public void routeTest() throws IOException { + Set targets = new HashSet<>(); + targets.add("spool"); + CFE07Routing cfe07Routing = new CFE07Routing("src/test/resources/cfe_07", targets); + + Hostname hostname = new Hostname("group-one-host-one"); + AppName appName = new AppName("group-one-tag-two"); + + Assertions.assertTrue(cfe07Routing.getTargets(hostname, appName.asCompatible()).contains("spool")); + + } +} diff --git a/src/test/java/com/teragrep/rlo_11/cfe_12/CFE12RoutingTest.java b/src/test/java/com/teragrep/rlo_11/cfe_12/CFE12RoutingTest.java new file mode 100644 index 0000000..a2cd83b --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/cfe_12/CFE12RoutingTest.java @@ -0,0 +1,68 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +public class CFE12RoutingTest { + + @Test + public void routeTest() throws IOException { + CFE12Routing cfe12Routing = new CFE12Routing("src/test/resources/cfe_12"); + + Hostname hostname = new Hostname("group-10-100"); + AppName appName = new AppName("124f76f0-net"); + + Assertions.assertTrue(cfe12Routing.getIndexes(hostname, appName).contains("network")); + Assertions.assertTrue(cfe12Routing.getSourcetypes(hostname, appName).contains("teragrep:mon:net_log:0")); + + } +} diff --git a/src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessorTest.java b/src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessorTest.java new file mode 100644 index 0000000..9f7d62e --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupProcessorTest.java @@ -0,0 +1,87 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; + +public class LogGroupProcessorTest { + + @Test + public void loadTest() throws IOException { + LogGroupProcessor logGroupProcessor = new LogGroupProcessor(); + LinkedList logGroupList = logGroupProcessor.load("src/test/resources/cfe_12"); + + // CFE-12 lookups have no way to determine all groups for host, iterating all + final String host = "example-test-host"; + final String tag = "f7a20104-flood-test.logGLOB"; + List indexList = new LinkedList<>(); + List sourcetypeList = new LinkedList<>(); + for (LogGroup group : logGroupList) { + + String index = group.getIndex(host, tag); + if (index != null) { + indexList.add(index); + } + + String sourcetype = group.getSourcetype(host, tag); + if (sourcetype != null) { + sourcetypeList.add(sourcetype); + } + } + + Assertions.assertEquals(1, indexList.size()); + Assertions.assertEquals("flood-test", indexList.get(0)); + + Assertions.assertEquals(1, sourcetypeList.size()); + Assertions.assertEquals("test:flood-test:0", sourcetypeList.get(0)); + + } +} diff --git a/src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupSearchTest.java b/src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupSearchTest.java new file mode 100644 index 0000000..81eca2f --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/cfe_12/LogGroupSearchTest.java @@ -0,0 +1,77 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_12; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.Set; + +public class LogGroupSearchTest { + + @Test + public void loadTest() throws IOException { + + try (DirectoryStream stream = Files.newDirectoryStream(Paths.get("src/test/resources/cfe_12"))) { + LogGroupSearch groupSearch = new LogGroupSearch(stream); + + final Set expectedSet = new HashSet<>(); + expectedSet.add("test-data"); + expectedSet.add("group-10"); + expectedSet.add("group-11"); + expectedSet.add("group-12"); + expectedSet.add("group-13"); + expectedSet.add("group-14"); + Assertions.assertEquals(expectedSet, groupSearch.getGroupList()); + } + } +} diff --git a/src/test/java/com/teragrep/rlo_11/cfe_16/CFE16RoutingTest.java b/src/test/java/com/teragrep/rlo_11/cfe_16/CFE16RoutingTest.java new file mode 100644 index 0000000..4339621 --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/cfe_16/CFE16RoutingTest.java @@ -0,0 +1,83 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.cfe_16; + +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.IOException; + +public class CFE16RoutingTest { + + @Test + public void routingTest() throws IOException { + CFE16Routing cfe16Routing = new CFE16Routing("src/test/resources/cfe_16"); + String authToken = "My RoutingKey having token"; + Hostname hostname = cfe16Routing.getHostname(authToken); + AppName appName = cfe16Routing.getAppName(authToken); + + Assertions.assertEquals("my-routingkey-having-hostname.example.com", hostname.hostname); + Assertions.assertEquals("capsulated", appName.appName); + } + + @Test + public void routingFailTest() throws IOException { + CFE16Routing cfe16Routing = new CFE16Routing("src/test/resources/cfe_16"); + + IllegalStateException thrown = Assertions.assertThrows(IllegalStateException.class, () -> { + String authToken = "token that does not exist"; + Hostname hostname = cfe16Routing.getHostname(authToken); + AppName appName = cfe16Routing.getAppName(authToken); + + appName.validate(); + hostname.validate(); // throws + }); + + Assertions.assertEquals("Unable to validate stub hostname", thrown.getMessage()); + } +} diff --git a/src/test/java/com/teragrep/rlo_11/key/RoutingKeyTest.java b/src/test/java/com/teragrep/rlo_11/key/RoutingKeyTest.java new file mode 100644 index 0000000..3a1c83b --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/key/RoutingKeyTest.java @@ -0,0 +1,106 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.key; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class RoutingKeyTest { + + @Test + public void testRoutingKey() { + Hostname hostname = new Hostname("host.example.com"); + AppName appName = new AppName("exampleAppName"); + + Assertions.assertTrue(hostname.validate()); + Assertions.assertTrue(appName.validate()); + Assertions.assertEquals("host.example.com", hostname.hostname); + + // appName and compatible appName should be the same + Assertions.assertEquals("exampleAppName", appName.appName); + Assertions.assertEquals("exampleAppName", appName.asCompatible().appName); + } + + @Test + public void testInvalidAppName() { + AppName appName = new AppName(":trimmed1"); + Assertions.assertFalse(appName.validate()); + + AppName appName2 = new AppName("/trimmed2"); + Assertions.assertFalse(appName2.validate()); + + AppName appName3 = new AppName("[trimmed3"); + Assertions.assertFalse(appName3.validate()); + + AppName appName4 = new AppName("."); + Assertions.assertFalse(appName4.validate()); + + AppName appName5 = new AppName(".."); + Assertions.assertFalse(appName5.validate()); + + // Empty tag is a valid case + AppName appName6 = new AppName(""); + Assertions.assertTrue(appName6.validate()); + } + + @Test + public void testAppNameSanitation() { + AppName appName = new AppName("F0o@bar"); + Assertions.assertEquals("F0o", appName.asCompatible().appName); + + AppName appName2 = new AppName("F0o.bar"); + Assertions.assertEquals("F0o.bar", appName2.asCompatible().appName); + + AppName appName3 = new AppName("F0o_bar"); + Assertions.assertEquals("F0o_bar", appName3.asCompatible().appName); + + AppName appName4 = new AppName("F0o,bar"); + Assertions.assertEquals("F0o", appName4.asCompatible().appName); + + AppName appName5 = new AppName("F0o-bar"); + Assertions.assertEquals("F0o-bar", appName5.asCompatible().appName); + } +} diff --git a/src/test/java/com/teragrep/rlo_11/kin_02/KIN02RoutingTest.java b/src/test/java/com/teragrep/rlo_11/kin_02/KIN02RoutingTest.java new file mode 100644 index 0000000..c0ced09 --- /dev/null +++ b/src/test/java/com/teragrep/rlo_11/kin_02/KIN02RoutingTest.java @@ -0,0 +1,100 @@ +/* + * Java Record Routing Library RLO-11 + * Copyright (C) 2021-2024 Suomen Kanuuna Oy + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * + * Additional permission under GNU Affero General Public License version 3 + * section 7 + * + * If you modify this Program, or any covered work, by linking or combining it + * with other code, such other code is not for that reason alone subject to any + * of the requirements of the GNU Affero GPL version 3 as long as this Program + * is the same Program as licensed from Suomen Kanuuna Oy without any additional + * modifications. + * + * Supplemented terms under GNU Affero General Public License version 3 + * section 7 + * + * Origin of the software must be attributed to Suomen Kanuuna Oy. Any modified + * versions must be marked as "Modified version of" The Program. + * + * Names of the licensors and authors may not be used for publicity purposes. + * + * No rights are granted for use of trade names, trademarks, or service marks + * which are in The Program if any. + * + * Licensee must indemnify licensors and authors for any liability that these + * contractual assumptions impose on licensors and authors. + * + * To the extent this program is licensed as part of the Commercial versions of + * Teragrep, the applicable Commercial License may apply to this file if you as + * a licensee so wish it. + */ +package com.teragrep.rlo_11.kin_02; + +import com.teragrep.rlo_11.key.AppName; +import com.teragrep.rlo_11.key.Hostname; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.io.FileNotFoundException; + +public class KIN02RoutingTest { + + @Test + public void testRouting() throws FileNotFoundException { + KIN02Routing kin02Routing = new KIN02Routing("src/test/resources/kin_02"); + + String account = "1234567890"; + String logGroup = "/example/logGroupName/ThatExists"; + + Hostname hostname = kin02Routing.getHostname(account); + AppName appName = kin02Routing.getAppName(logGroup); + + Assertions.assertEquals("1234567890.host.example.com", hostname.hostname); + Assertions.assertEquals("exampleAppName", appName.appName); + } + + @Test + public void testFailRouting() throws FileNotFoundException { + KIN02Routing kin02Routing = new KIN02Routing("src/test/resources/kin_02"); + + IllegalStateException thrown = Assertions.assertThrows(IllegalStateException.class, () -> { + String account = "0987654321"; + String logGroup = "/example/logGroupName/ThatExists"; + Hostname hostname = kin02Routing.getHostname(account); + AppName appName = kin02Routing.getAppName(logGroup); + + appName.validate(); + hostname.validate(); // throws + }); + + Assertions.assertEquals("Unable to validate stub hostname", thrown.getMessage()); + + IllegalStateException thrownToo = Assertions.assertThrows(IllegalStateException.class, () -> { + String account = "1234567890"; + String logGroup = "/example/logGroupName/ThatDoesNotExists"; + + Hostname hostname = kin02Routing.getHostname(account); + AppName appName = kin02Routing.getAppName(logGroup); + + hostname.validate(); + appName.validate(); // throws + }); + + Assertions.assertEquals("Unable to validate stub appName", thrownToo.getMessage()); + } +} diff --git a/src/test/resources/cfe_07/es_hosts.json b/src/test/resources/cfe_07/es_hosts.json new file mode 100644 index 0000000..ed8c5cf --- /dev/null +++ b/src/test/resources/cfe_07/es_hosts.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "es-host", + "value": "true" + } + ] +} diff --git a/src/test/resources/cfe_07/es_target_es.json b/src/test/resources/cfe_07/es_target_es.json new file mode 100644 index 0000000..f413e10 --- /dev/null +++ b/src/test/resources/cfe_07/es_target_es.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "es-tag", + "value": "true" + } + ] +} diff --git a/src/test/resources/cfe_07/group-one_hosts.json b/src/test/resources/cfe_07/group-one_hosts.json new file mode 100644 index 0000000..ccbb9a0 --- /dev/null +++ b/src/test/resources/cfe_07/group-one_hosts.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-one-host-one", + "value": "true" + }, + { + "index": "group-one-host-two", + "value": "true" + } + ] +} diff --git a/src/test/resources/cfe_07/group-one_target_spool.json b/src/test/resources/cfe_07/group-one_target_spool.json new file mode 100644 index 0000000..c431ee0 --- /dev/null +++ b/src/test/resources/cfe_07/group-one_target_spool.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "", + "value": "true" + }, + { + "index": "group-one-tag-one", + "value": "true" + }, + { + "index": "group-one-tag-two", + "value": "true" + }, + { + "index": "common-tag", + "value": "true" + } + ] +} diff --git a/src/test/resources/cfe_07/group-two_hosts.json b/src/test/resources/cfe_07/group-two_hosts.json new file mode 100644 index 0000000..1b0bcab --- /dev/null +++ b/src/test/resources/cfe_07/group-two_hosts.json @@ -0,0 +1,15 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-two-host-one", + "value": "true" + }, + { + "index": "group-two-host-two", + "value": "true" + } + ] +} diff --git a/src/test/resources/cfe_07/group-two_target_spool.json b/src/test/resources/cfe_07/group-two_target_spool.json new file mode 100644 index 0000000..17830a8 --- /dev/null +++ b/src/test/resources/cfe_07/group-two_target_spool.json @@ -0,0 +1,23 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "", + "value": "true" + }, + { + "index": "group-two-tag-one", + "value": "true" + }, + { + "index": "group-two-tag-two", + "value": "true" + }, + { + "index": "common-tag", + "value": "true" + } + ] +} diff --git a/src/test/resources/cfe_12/group-10_hosts.json b/src/test/resources/cfe_12/group-10_hosts.json new file mode 100644 index 0000000..9f817e4 --- /dev/null +++ b/src/test/resources/cfe_12/group-10_hosts.json @@ -0,0 +1,991 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-10-100", + "value": true + }, + { + "index": "group-10-101", + "value": true + }, + { + "index": "group-10-102", + "value": true + }, + { + "index": "group-10-103", + "value": true + }, + { + "index": "group-10-104", + "value": true + }, + { + "index": "group-10-105", + "value": true + }, + { + "index": "group-10-106", + "value": true + }, + { + "index": "group-10-107", + "value": true + }, + { + "index": "group-10-108", + "value": true + }, + { + "index": "group-10-109", + "value": true + }, + { + "index": "group-10-10", + "value": true + }, + { + "index": "group-10-110", + "value": true + }, + { + "index": "group-10-111", + "value": true + }, + { + "index": "group-10-112", + "value": true + }, + { + "index": "group-10-113", + "value": true + }, + { + "index": "group-10-114", + "value": true + }, + { + "index": "group-10-115", + "value": true + }, + { + "index": "group-10-116", + "value": true + }, + { + "index": "group-10-117", + "value": true + }, + { + "index": "group-10-118", + "value": true + }, + { + "index": "group-10-119", + "value": true + }, + { + "index": "group-10-11", + "value": true + }, + { + "index": "group-10-120", + "value": true + }, + { + "index": "group-10-121", + "value": true + }, + { + "index": "group-10-122", + "value": true + }, + { + "index": "group-10-123", + "value": true + }, + { + "index": "group-10-124", + "value": true + }, + { + "index": "group-10-125", + "value": true + }, + { + "index": "group-10-126", + "value": true + }, + { + "index": "group-10-127", + "value": true + }, + { + "index": "group-10-128", + "value": true + }, + { + "index": "group-10-129", + "value": true + }, + { + "index": "group-10-12", + "value": true + }, + { + "index": "group-10-130", + "value": true + }, + { + "index": "group-10-131", + "value": true + }, + { + "index": "group-10-132", + "value": true + }, + { + "index": "group-10-133", + "value": true + }, + { + "index": "group-10-134", + "value": true + }, + { + "index": "group-10-135", + "value": true + }, + { + "index": "group-10-136", + "value": true + }, + { + "index": "group-10-137", + "value": true + }, + { + "index": "group-10-138", + "value": true + }, + { + "index": "group-10-139", + "value": true + }, + { + "index": "group-10-13", + "value": true + }, + { + "index": "group-10-140", + "value": true + }, + { + "index": "group-10-141", + "value": true + }, + { + "index": "group-10-142", + "value": true + }, + { + "index": "group-10-143", + "value": true + }, + { + "index": "group-10-144", + "value": true + }, + { + "index": "group-10-145", + "value": true + }, + { + "index": "group-10-146", + "value": true + }, + { + "index": "group-10-147", + "value": true + }, + { + "index": "group-10-148", + "value": true + }, + { + "index": "group-10-149", + "value": true + }, + { + "index": "group-10-14", + "value": true + }, + { + "index": "group-10-150", + "value": true + }, + { + "index": "group-10-151", + "value": true + }, + { + "index": "group-10-152", + "value": true + }, + { + "index": "group-10-153", + "value": true + }, + { + "index": "group-10-154", + "value": true + }, + { + "index": "group-10-155", + "value": true + }, + { + "index": "group-10-156", + "value": true + }, + { + "index": "group-10-157", + "value": true + }, + { + "index": "group-10-158", + "value": true + }, + { + "index": "group-10-159", + "value": true + }, + { + "index": "group-10-15", + "value": true + }, + { + "index": "group-10-160", + "value": true + }, + { + "index": "group-10-161", + "value": true + }, + { + "index": "group-10-162", + "value": true + }, + { + "index": "group-10-163", + "value": true + }, + { + "index": "group-10-164", + "value": true + }, + { + "index": "group-10-165", + "value": true + }, + { + "index": "group-10-166", + "value": true + }, + { + "index": "group-10-167", + "value": true + }, + { + "index": "group-10-168", + "value": true + }, + { + "index": "group-10-169", + "value": true + }, + { + "index": "group-10-16", + "value": true + }, + { + "index": "group-10-170", + "value": true + }, + { + "index": "group-10-171", + "value": true + }, + { + "index": "group-10-172", + "value": true + }, + { + "index": "group-10-173", + "value": true + }, + { + "index": "group-10-174", + "value": true + }, + { + "index": "group-10-175", + "value": true + }, + { + "index": "group-10-176", + "value": true + }, + { + "index": "group-10-177", + "value": true + }, + { + "index": "group-10-178", + "value": true + }, + { + "index": "group-10-179", + "value": true + }, + { + "index": "group-10-17", + "value": true + }, + { + "index": "group-10-180", + "value": true + }, + { + "index": "group-10-181", + "value": true + }, + { + "index": "group-10-182", + "value": true + }, + { + "index": "group-10-183", + "value": true + }, + { + "index": "group-10-184", + "value": true + }, + { + "index": "group-10-185", + "value": true + }, + { + "index": "group-10-186", + "value": true + }, + { + "index": "group-10-187", + "value": true + }, + { + "index": "group-10-188", + "value": true + }, + { + "index": "group-10-189", + "value": true + }, + { + "index": "group-10-18", + "value": true + }, + { + "index": "group-10-190", + "value": true + }, + { + "index": "group-10-191", + "value": true + }, + { + "index": "group-10-192", + "value": true + }, + { + "index": "group-10-193", + "value": true + }, + { + "index": "group-10-194", + "value": true + }, + { + "index": "group-10-195", + "value": true + }, + { + "index": "group-10-196", + "value": true + }, + { + "index": "group-10-197", + "value": true + }, + { + "index": "group-10-198", + "value": true + }, + { + "index": "group-10-199", + "value": true + }, + { + "index": "group-10-19", + "value": true + }, + { + "index": "group-10-200", + "value": true + }, + { + "index": "group-10-201", + "value": true + }, + { + "index": "group-10-202", + "value": true + }, + { + "index": "group-10-203", + "value": true + }, + { + "index": "group-10-204", + "value": true + }, + { + "index": "group-10-205", + "value": true + }, + { + "index": "group-10-206", + "value": true + }, + { + "index": "group-10-207", + "value": true + }, + { + "index": "group-10-208", + "value": true + }, + { + "index": "group-10-209", + "value": true + }, + { + "index": "group-10-20", + "value": true + }, + { + "index": "group-10-210", + "value": true + }, + { + "index": "group-10-211", + "value": true + }, + { + "index": "group-10-212", + "value": true + }, + { + "index": "group-10-213", + "value": true + }, + { + "index": "group-10-214", + "value": true + }, + { + "index": "group-10-215", + "value": true + }, + { + "index": "group-10-216", + "value": true + }, + { + "index": "group-10-217", + "value": true + }, + { + "index": "group-10-218", + "value": true + }, + { + "index": "group-10-219", + "value": true + }, + { + "index": "group-10-21", + "value": true + }, + { + "index": "group-10-220", + "value": true + }, + { + "index": "group-10-221", + "value": true + }, + { + "index": "group-10-222", + "value": true + }, + { + "index": "group-10-223", + "value": true + }, + { + "index": "group-10-224", + "value": true + }, + { + "index": "group-10-225", + "value": true + }, + { + "index": "group-10-226", + "value": true + }, + { + "index": "group-10-227", + "value": true + }, + { + "index": "group-10-228", + "value": true + }, + { + "index": "group-10-229", + "value": true + }, + { + "index": "group-10-22", + "value": true + }, + { + "index": "group-10-230", + "value": true + }, + { + "index": "group-10-231", + "value": true + }, + { + "index": "group-10-232", + "value": true + }, + { + "index": "group-10-233", + "value": true + }, + { + "index": "group-10-234", + "value": true + }, + { + "index": "group-10-235", + "value": true + }, + { + "index": "group-10-236", + "value": true + }, + { + "index": "group-10-237", + "value": true + }, + { + "index": "group-10-238", + "value": true + }, + { + "index": "group-10-239", + "value": true + }, + { + "index": "group-10-23", + "value": true + }, + { + "index": "group-10-240", + "value": true + }, + { + "index": "group-10-241", + "value": true + }, + { + "index": "group-10-242", + "value": true + }, + { + "index": "group-10-243", + "value": true + }, + { + "index": "group-10-244", + "value": true + }, + { + "index": "group-10-245", + "value": true + }, + { + "index": "group-10-246", + "value": true + }, + { + "index": "group-10-247", + "value": true + }, + { + "index": "group-10-248", + "value": true + }, + { + "index": "group-10-249", + "value": true + }, + { + "index": "group-10-24", + "value": true + }, + { + "index": "group-10-250", + "value": true + }, + { + "index": "group-10-251", + "value": true + }, + { + "index": "group-10-252", + "value": true + }, + { + "index": "group-10-253", + "value": true + }, + { + "index": "group-10-254", + "value": true + }, + { + "index": "group-10-255", + "value": true + }, + { + "index": "group-10-25", + "value": true + }, + { + "index": "group-10-26", + "value": true + }, + { + "index": "group-10-27", + "value": true + }, + { + "index": "group-10-28", + "value": true + }, + { + "index": "group-10-29", + "value": true + }, + { + "index": "group-10-30", + "value": true + }, + { + "index": "group-10-31", + "value": true + }, + { + "index": "group-10-32", + "value": true + }, + { + "index": "group-10-33", + "value": true + }, + { + "index": "group-10-34", + "value": true + }, + { + "index": "group-10-35", + "value": true + }, + { + "index": "group-10-36", + "value": true + }, + { + "index": "group-10-37", + "value": true + }, + { + "index": "group-10-38", + "value": true + }, + { + "index": "group-10-39", + "value": true + }, + { + "index": "group-10-40", + "value": true + }, + { + "index": "group-10-41", + "value": true + }, + { + "index": "group-10-42", + "value": true + }, + { + "index": "group-10-43", + "value": true + }, + { + "index": "group-10-44", + "value": true + }, + { + "index": "group-10-45", + "value": true + }, + { + "index": "group-10-46", + "value": true + }, + { + "index": "group-10-47", + "value": true + }, + { + "index": "group-10-48", + "value": true + }, + { + "index": "group-10-49", + "value": true + }, + { + "index": "group-10-50", + "value": true + }, + { + "index": "group-10-51", + "value": true + }, + { + "index": "group-10-52", + "value": true + }, + { + "index": "group-10-53", + "value": true + }, + { + "index": "group-10-54", + "value": true + }, + { + "index": "group-10-55", + "value": true + }, + { + "index": "group-10-56", + "value": true + }, + { + "index": "group-10-57", + "value": true + }, + { + "index": "group-10-58", + "value": true + }, + { + "index": "group-10-59", + "value": true + }, + { + "index": "group-10-60", + "value": true + }, + { + "index": "group-10-61", + "value": true + }, + { + "index": "group-10-62", + "value": true + }, + { + "index": "group-10-63", + "value": true + }, + { + "index": "group-10-64", + "value": true + }, + { + "index": "group-10-65", + "value": true + }, + { + "index": "group-10-66", + "value": true + }, + { + "index": "group-10-67", + "value": true + }, + { + "index": "group-10-68", + "value": true + }, + { + "index": "group-10-69", + "value": true + }, + { + "index": "group-10-70", + "value": true + }, + { + "index": "group-10-71", + "value": true + }, + { + "index": "group-10-72", + "value": true + }, + { + "index": "group-10-73", + "value": true + }, + { + "index": "group-10-74", + "value": true + }, + { + "index": "group-10-75", + "value": true + }, + { + "index": "group-10-76", + "value": true + }, + { + "index": "group-10-77", + "value": true + }, + { + "index": "group-10-78", + "value": true + }, + { + "index": "group-10-79", + "value": true + }, + { + "index": "group-10-80", + "value": true + }, + { + "index": "group-10-81", + "value": true + }, + { + "index": "group-10-82", + "value": true + }, + { + "index": "group-10-83", + "value": true + }, + { + "index": "group-10-84", + "value": true + }, + { + "index": "group-10-85", + "value": true + }, + { + "index": "group-10-86", + "value": true + }, + { + "index": "group-10-87", + "value": true + }, + { + "index": "group-10-88", + "value": true + }, + { + "index": "group-10-89", + "value": true + }, + { + "index": "group-10-90", + "value": true + }, + { + "index": "group-10-91", + "value": true + }, + { + "index": "group-10-92", + "value": true + }, + { + "index": "group-10-93", + "value": true + }, + { + "index": "group-10-94", + "value": true + }, + { + "index": "group-10-95", + "value": true + }, + { + "index": "group-10-96", + "value": true + }, + { + "index": "group-10-97", + "value": true + }, + { + "index": "group-10-98", + "value": true + }, + { + "index": "group-10-99", + "value": true + } + ] +} diff --git a/src/test/resources/cfe_12/group-10_indexes.json b/src/test/resources/cfe_12/group-10_indexes.json new file mode 100644 index 0000000..df74834 --- /dev/null +++ b/src/test/resources/cfe_12/group-10_indexes.json @@ -0,0 +1,43 @@ +{ + "nomatch": "unknown", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "cpu" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "cpu" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "memory" + }, + { + "index": "7ee85a32-vmstat", + "value": "memory" + }, + { + "index": "124f76f0-net", + "value": "network" + }, + { + "index": "8411b757-fs-block", + "value": "storage" + }, + { + "index": "dd731d68-fs-inode", + "value": "storage" + }, + { + "index": "afe23b85-io", + "value": "storage" + }, + { + "index": "62a28466-pid-disk", + "value": "storage" + } + ], + "type": "string", + "version": 1 +} diff --git a/src/test/resources/cfe_12/group-10_sourcetypes.json b/src/test/resources/cfe_12/group-10_sourcetypes.json new file mode 100644 index 0000000..9a2148f --- /dev/null +++ b/src/test/resources/cfe_12/group-10_sourcetypes.json @@ -0,0 +1,43 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "teragrep:mon:cpu_log:0" + }, + { + "index": "124f76f0-net", + "value": "teragrep:mon:net_log:0" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "teragrep:mon:pid-page-memory_log:0" + }, + { + "index": "62a28466-pid-disk", + "value": "teragrep:mon:pid-disk_log:0" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "teragrep:mon:pid-cpu_log:0" + }, + { + "index": "7ee85a32-vmstat", + "value": "teragrep:mon:vmstat_log:0" + }, + { + "index": "8411b757-fs-block", + "value": "teragrep:mon:fs-block_log:0" + }, + { + "index": "afe23b85-io", + "value": "teragrep:mon:io_log:0" + }, + { + "index": "dd731d68-fs-inode", + "value": "teragrep:mon:fs-inode_log:0" + } + ] +} diff --git a/src/test/resources/cfe_12/group-11_hosts.json b/src/test/resources/cfe_12/group-11_hosts.json new file mode 100644 index 0000000..841b9a6 --- /dev/null +++ b/src/test/resources/cfe_12/group-11_hosts.json @@ -0,0 +1,991 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-11-100", + "value": true + }, + { + "index": "group-11-101", + "value": true + }, + { + "index": "group-11-102", + "value": true + }, + { + "index": "group-11-103", + "value": true + }, + { + "index": "group-11-104", + "value": true + }, + { + "index": "group-11-105", + "value": true + }, + { + "index": "group-11-106", + "value": true + }, + { + "index": "group-11-107", + "value": true + }, + { + "index": "group-11-108", + "value": true + }, + { + "index": "group-11-109", + "value": true + }, + { + "index": "group-11-10", + "value": true + }, + { + "index": "group-11-110", + "value": true + }, + { + "index": "group-11-111", + "value": true + }, + { + "index": "group-11-112", + "value": true + }, + { + "index": "group-11-113", + "value": true + }, + { + "index": "group-11-114", + "value": true + }, + { + "index": "group-11-115", + "value": true + }, + { + "index": "group-11-116", + "value": true + }, + { + "index": "group-11-117", + "value": true + }, + { + "index": "group-11-118", + "value": true + }, + { + "index": "group-11-119", + "value": true + }, + { + "index": "group-11-11", + "value": true + }, + { + "index": "group-11-120", + "value": true + }, + { + "index": "group-11-121", + "value": true + }, + { + "index": "group-11-122", + "value": true + }, + { + "index": "group-11-123", + "value": true + }, + { + "index": "group-11-124", + "value": true + }, + { + "index": "group-11-125", + "value": true + }, + { + "index": "group-11-126", + "value": true + }, + { + "index": "group-11-127", + "value": true + }, + { + "index": "group-11-128", + "value": true + }, + { + "index": "group-11-129", + "value": true + }, + { + "index": "group-11-12", + "value": true + }, + { + "index": "group-11-130", + "value": true + }, + { + "index": "group-11-131", + "value": true + }, + { + "index": "group-11-132", + "value": true + }, + { + "index": "group-11-133", + "value": true + }, + { + "index": "group-11-134", + "value": true + }, + { + "index": "group-11-135", + "value": true + }, + { + "index": "group-11-136", + "value": true + }, + { + "index": "group-11-137", + "value": true + }, + { + "index": "group-11-138", + "value": true + }, + { + "index": "group-11-139", + "value": true + }, + { + "index": "group-11-13", + "value": true + }, + { + "index": "group-11-140", + "value": true + }, + { + "index": "group-11-141", + "value": true + }, + { + "index": "group-11-142", + "value": true + }, + { + "index": "group-11-143", + "value": true + }, + { + "index": "group-11-144", + "value": true + }, + { + "index": "group-11-145", + "value": true + }, + { + "index": "group-11-146", + "value": true + }, + { + "index": "group-11-147", + "value": true + }, + { + "index": "group-11-148", + "value": true + }, + { + "index": "group-11-149", + "value": true + }, + { + "index": "group-11-14", + "value": true + }, + { + "index": "group-11-150", + "value": true + }, + { + "index": "group-11-151", + "value": true + }, + { + "index": "group-11-152", + "value": true + }, + { + "index": "group-11-153", + "value": true + }, + { + "index": "group-11-154", + "value": true + }, + { + "index": "group-11-155", + "value": true + }, + { + "index": "group-11-156", + "value": true + }, + { + "index": "group-11-157", + "value": true + }, + { + "index": "group-11-158", + "value": true + }, + { + "index": "group-11-159", + "value": true + }, + { + "index": "group-11-15", + "value": true + }, + { + "index": "group-11-160", + "value": true + }, + { + "index": "group-11-161", + "value": true + }, + { + "index": "group-11-162", + "value": true + }, + { + "index": "group-11-163", + "value": true + }, + { + "index": "group-11-164", + "value": true + }, + { + "index": "group-11-165", + "value": true + }, + { + "index": "group-11-166", + "value": true + }, + { + "index": "group-11-167", + "value": true + }, + { + "index": "group-11-168", + "value": true + }, + { + "index": "group-11-169", + "value": true + }, + { + "index": "group-11-16", + "value": true + }, + { + "index": "group-11-170", + "value": true + }, + { + "index": "group-11-171", + "value": true + }, + { + "index": "group-11-172", + "value": true + }, + { + "index": "group-11-173", + "value": true + }, + { + "index": "group-11-174", + "value": true + }, + { + "index": "group-11-175", + "value": true + }, + { + "index": "group-11-176", + "value": true + }, + { + "index": "group-11-177", + "value": true + }, + { + "index": "group-11-178", + "value": true + }, + { + "index": "group-11-179", + "value": true + }, + { + "index": "group-11-17", + "value": true + }, + { + "index": "group-11-180", + "value": true + }, + { + "index": "group-11-181", + "value": true + }, + { + "index": "group-11-182", + "value": true + }, + { + "index": "group-11-183", + "value": true + }, + { + "index": "group-11-184", + "value": true + }, + { + "index": "group-11-185", + "value": true + }, + { + "index": "group-11-186", + "value": true + }, + { + "index": "group-11-187", + "value": true + }, + { + "index": "group-11-188", + "value": true + }, + { + "index": "group-11-189", + "value": true + }, + { + "index": "group-11-18", + "value": true + }, + { + "index": "group-11-190", + "value": true + }, + { + "index": "group-11-191", + "value": true + }, + { + "index": "group-11-192", + "value": true + }, + { + "index": "group-11-193", + "value": true + }, + { + "index": "group-11-194", + "value": true + }, + { + "index": "group-11-195", + "value": true + }, + { + "index": "group-11-196", + "value": true + }, + { + "index": "group-11-197", + "value": true + }, + { + "index": "group-11-198", + "value": true + }, + { + "index": "group-11-199", + "value": true + }, + { + "index": "group-11-19", + "value": true + }, + { + "index": "group-11-200", + "value": true + }, + { + "index": "group-11-201", + "value": true + }, + { + "index": "group-11-202", + "value": true + }, + { + "index": "group-11-203", + "value": true + }, + { + "index": "group-11-204", + "value": true + }, + { + "index": "group-11-205", + "value": true + }, + { + "index": "group-11-206", + "value": true + }, + { + "index": "group-11-207", + "value": true + }, + { + "index": "group-11-208", + "value": true + }, + { + "index": "group-11-209", + "value": true + }, + { + "index": "group-11-20", + "value": true + }, + { + "index": "group-11-210", + "value": true + }, + { + "index": "group-11-211", + "value": true + }, + { + "index": "group-11-212", + "value": true + }, + { + "index": "group-11-213", + "value": true + }, + { + "index": "group-11-214", + "value": true + }, + { + "index": "group-11-215", + "value": true + }, + { + "index": "group-11-216", + "value": true + }, + { + "index": "group-11-217", + "value": true + }, + { + "index": "group-11-218", + "value": true + }, + { + "index": "group-11-219", + "value": true + }, + { + "index": "group-11-21", + "value": true + }, + { + "index": "group-11-220", + "value": true + }, + { + "index": "group-11-221", + "value": true + }, + { + "index": "group-11-222", + "value": true + }, + { + "index": "group-11-223", + "value": true + }, + { + "index": "group-11-224", + "value": true + }, + { + "index": "group-11-225", + "value": true + }, + { + "index": "group-11-226", + "value": true + }, + { + "index": "group-11-227", + "value": true + }, + { + "index": "group-11-228", + "value": true + }, + { + "index": "group-11-229", + "value": true + }, + { + "index": "group-11-22", + "value": true + }, + { + "index": "group-11-230", + "value": true + }, + { + "index": "group-11-231", + "value": true + }, + { + "index": "group-11-232", + "value": true + }, + { + "index": "group-11-233", + "value": true + }, + { + "index": "group-11-234", + "value": true + }, + { + "index": "group-11-235", + "value": true + }, + { + "index": "group-11-236", + "value": true + }, + { + "index": "group-11-237", + "value": true + }, + { + "index": "group-11-238", + "value": true + }, + { + "index": "group-11-239", + "value": true + }, + { + "index": "group-11-23", + "value": true + }, + { + "index": "group-11-240", + "value": true + }, + { + "index": "group-11-241", + "value": true + }, + { + "index": "group-11-242", + "value": true + }, + { + "index": "group-11-243", + "value": true + }, + { + "index": "group-11-244", + "value": true + }, + { + "index": "group-11-245", + "value": true + }, + { + "index": "group-11-246", + "value": true + }, + { + "index": "group-11-247", + "value": true + }, + { + "index": "group-11-248", + "value": true + }, + { + "index": "group-11-249", + "value": true + }, + { + "index": "group-11-24", + "value": true + }, + { + "index": "group-11-250", + "value": true + }, + { + "index": "group-11-251", + "value": true + }, + { + "index": "group-11-252", + "value": true + }, + { + "index": "group-11-253", + "value": true + }, + { + "index": "group-11-254", + "value": true + }, + { + "index": "group-11-255", + "value": true + }, + { + "index": "group-11-25", + "value": true + }, + { + "index": "group-11-26", + "value": true + }, + { + "index": "group-11-27", + "value": true + }, + { + "index": "group-11-28", + "value": true + }, + { + "index": "group-11-29", + "value": true + }, + { + "index": "group-11-30", + "value": true + }, + { + "index": "group-11-31", + "value": true + }, + { + "index": "group-11-32", + "value": true + }, + { + "index": "group-11-33", + "value": true + }, + { + "index": "group-11-34", + "value": true + }, + { + "index": "group-11-35", + "value": true + }, + { + "index": "group-11-36", + "value": true + }, + { + "index": "group-11-37", + "value": true + }, + { + "index": "group-11-38", + "value": true + }, + { + "index": "group-11-39", + "value": true + }, + { + "index": "group-11-40", + "value": true + }, + { + "index": "group-11-41", + "value": true + }, + { + "index": "group-11-42", + "value": true + }, + { + "index": "group-11-43", + "value": true + }, + { + "index": "group-11-44", + "value": true + }, + { + "index": "group-11-45", + "value": true + }, + { + "index": "group-11-46", + "value": true + }, + { + "index": "group-11-47", + "value": true + }, + { + "index": "group-11-48", + "value": true + }, + { + "index": "group-11-49", + "value": true + }, + { + "index": "group-11-50", + "value": true + }, + { + "index": "group-11-51", + "value": true + }, + { + "index": "group-11-52", + "value": true + }, + { + "index": "group-11-53", + "value": true + }, + { + "index": "group-11-54", + "value": true + }, + { + "index": "group-11-55", + "value": true + }, + { + "index": "group-11-56", + "value": true + }, + { + "index": "group-11-57", + "value": true + }, + { + "index": "group-11-58", + "value": true + }, + { + "index": "group-11-59", + "value": true + }, + { + "index": "group-11-60", + "value": true + }, + { + "index": "group-11-61", + "value": true + }, + { + "index": "group-11-62", + "value": true + }, + { + "index": "group-11-63", + "value": true + }, + { + "index": "group-11-64", + "value": true + }, + { + "index": "group-11-65", + "value": true + }, + { + "index": "group-11-66", + "value": true + }, + { + "index": "group-11-67", + "value": true + }, + { + "index": "group-11-68", + "value": true + }, + { + "index": "group-11-69", + "value": true + }, + { + "index": "group-11-70", + "value": true + }, + { + "index": "group-11-71", + "value": true + }, + { + "index": "group-11-72", + "value": true + }, + { + "index": "group-11-73", + "value": true + }, + { + "index": "group-11-74", + "value": true + }, + { + "index": "group-11-75", + "value": true + }, + { + "index": "group-11-76", + "value": true + }, + { + "index": "group-11-77", + "value": true + }, + { + "index": "group-11-78", + "value": true + }, + { + "index": "group-11-79", + "value": true + }, + { + "index": "group-11-80", + "value": true + }, + { + "index": "group-11-81", + "value": true + }, + { + "index": "group-11-82", + "value": true + }, + { + "index": "group-11-83", + "value": true + }, + { + "index": "group-11-84", + "value": true + }, + { + "index": "group-11-85", + "value": true + }, + { + "index": "group-11-86", + "value": true + }, + { + "index": "group-11-87", + "value": true + }, + { + "index": "group-11-88", + "value": true + }, + { + "index": "group-11-89", + "value": true + }, + { + "index": "group-11-90", + "value": true + }, + { + "index": "group-11-91", + "value": true + }, + { + "index": "group-11-92", + "value": true + }, + { + "index": "group-11-93", + "value": true + }, + { + "index": "group-11-94", + "value": true + }, + { + "index": "group-11-95", + "value": true + }, + { + "index": "group-11-96", + "value": true + }, + { + "index": "group-11-97", + "value": true + }, + { + "index": "group-11-98", + "value": true + }, + { + "index": "group-11-99", + "value": true + } + ] +} diff --git a/src/test/resources/cfe_12/group-11_indexes.json b/src/test/resources/cfe_12/group-11_indexes.json new file mode 100644 index 0000000..df74834 --- /dev/null +++ b/src/test/resources/cfe_12/group-11_indexes.json @@ -0,0 +1,43 @@ +{ + "nomatch": "unknown", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "cpu" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "cpu" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "memory" + }, + { + "index": "7ee85a32-vmstat", + "value": "memory" + }, + { + "index": "124f76f0-net", + "value": "network" + }, + { + "index": "8411b757-fs-block", + "value": "storage" + }, + { + "index": "dd731d68-fs-inode", + "value": "storage" + }, + { + "index": "afe23b85-io", + "value": "storage" + }, + { + "index": "62a28466-pid-disk", + "value": "storage" + } + ], + "type": "string", + "version": 1 +} diff --git a/src/test/resources/cfe_12/group-11_sourcetypes.json b/src/test/resources/cfe_12/group-11_sourcetypes.json new file mode 100644 index 0000000..9a2148f --- /dev/null +++ b/src/test/resources/cfe_12/group-11_sourcetypes.json @@ -0,0 +1,43 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "teragrep:mon:cpu_log:0" + }, + { + "index": "124f76f0-net", + "value": "teragrep:mon:net_log:0" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "teragrep:mon:pid-page-memory_log:0" + }, + { + "index": "62a28466-pid-disk", + "value": "teragrep:mon:pid-disk_log:0" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "teragrep:mon:pid-cpu_log:0" + }, + { + "index": "7ee85a32-vmstat", + "value": "teragrep:mon:vmstat_log:0" + }, + { + "index": "8411b757-fs-block", + "value": "teragrep:mon:fs-block_log:0" + }, + { + "index": "afe23b85-io", + "value": "teragrep:mon:io_log:0" + }, + { + "index": "dd731d68-fs-inode", + "value": "teragrep:mon:fs-inode_log:0" + } + ] +} diff --git a/src/test/resources/cfe_12/group-12_hosts.json b/src/test/resources/cfe_12/group-12_hosts.json new file mode 100644 index 0000000..a7cc6c5 --- /dev/null +++ b/src/test/resources/cfe_12/group-12_hosts.json @@ -0,0 +1,991 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-12-100", + "value": true + }, + { + "index": "group-12-101", + "value": true + }, + { + "index": "group-12-102", + "value": true + }, + { + "index": "group-12-103", + "value": true + }, + { + "index": "group-12-104", + "value": true + }, + { + "index": "group-12-105", + "value": true + }, + { + "index": "group-12-106", + "value": true + }, + { + "index": "group-12-107", + "value": true + }, + { + "index": "group-12-108", + "value": true + }, + { + "index": "group-12-109", + "value": true + }, + { + "index": "group-12-10", + "value": true + }, + { + "index": "group-12-110", + "value": true + }, + { + "index": "group-12-111", + "value": true + }, + { + "index": "group-12-112", + "value": true + }, + { + "index": "group-12-113", + "value": true + }, + { + "index": "group-12-114", + "value": true + }, + { + "index": "group-12-115", + "value": true + }, + { + "index": "group-12-116", + "value": true + }, + { + "index": "group-12-117", + "value": true + }, + { + "index": "group-12-118", + "value": true + }, + { + "index": "group-12-119", + "value": true + }, + { + "index": "group-12-11", + "value": true + }, + { + "index": "group-12-120", + "value": true + }, + { + "index": "group-12-121", + "value": true + }, + { + "index": "group-12-122", + "value": true + }, + { + "index": "group-12-123", + "value": true + }, + { + "index": "group-12-124", + "value": true + }, + { + "index": "group-12-125", + "value": true + }, + { + "index": "group-12-126", + "value": true + }, + { + "index": "group-12-127", + "value": true + }, + { + "index": "group-12-128", + "value": true + }, + { + "index": "group-12-129", + "value": true + }, + { + "index": "group-12-12", + "value": true + }, + { + "index": "group-12-130", + "value": true + }, + { + "index": "group-12-131", + "value": true + }, + { + "index": "group-12-132", + "value": true + }, + { + "index": "group-12-133", + "value": true + }, + { + "index": "group-12-134", + "value": true + }, + { + "index": "group-12-135", + "value": true + }, + { + "index": "group-12-136", + "value": true + }, + { + "index": "group-12-137", + "value": true + }, + { + "index": "group-12-138", + "value": true + }, + { + "index": "group-12-139", + "value": true + }, + { + "index": "group-12-13", + "value": true + }, + { + "index": "group-12-140", + "value": true + }, + { + "index": "group-12-141", + "value": true + }, + { + "index": "group-12-142", + "value": true + }, + { + "index": "group-12-143", + "value": true + }, + { + "index": "group-12-144", + "value": true + }, + { + "index": "group-12-145", + "value": true + }, + { + "index": "group-12-146", + "value": true + }, + { + "index": "group-12-147", + "value": true + }, + { + "index": "group-12-148", + "value": true + }, + { + "index": "group-12-149", + "value": true + }, + { + "index": "group-12-14", + "value": true + }, + { + "index": "group-12-150", + "value": true + }, + { + "index": "group-12-151", + "value": true + }, + { + "index": "group-12-152", + "value": true + }, + { + "index": "group-12-153", + "value": true + }, + { + "index": "group-12-154", + "value": true + }, + { + "index": "group-12-155", + "value": true + }, + { + "index": "group-12-156", + "value": true + }, + { + "index": "group-12-157", + "value": true + }, + { + "index": "group-12-158", + "value": true + }, + { + "index": "group-12-159", + "value": true + }, + { + "index": "group-12-15", + "value": true + }, + { + "index": "group-12-160", + "value": true + }, + { + "index": "group-12-161", + "value": true + }, + { + "index": "group-12-162", + "value": true + }, + { + "index": "group-12-163", + "value": true + }, + { + "index": "group-12-164", + "value": true + }, + { + "index": "group-12-165", + "value": true + }, + { + "index": "group-12-166", + "value": true + }, + { + "index": "group-12-167", + "value": true + }, + { + "index": "group-12-168", + "value": true + }, + { + "index": "group-12-169", + "value": true + }, + { + "index": "group-12-16", + "value": true + }, + { + "index": "group-12-170", + "value": true + }, + { + "index": "group-12-171", + "value": true + }, + { + "index": "group-12-172", + "value": true + }, + { + "index": "group-12-173", + "value": true + }, + { + "index": "group-12-174", + "value": true + }, + { + "index": "group-12-175", + "value": true + }, + { + "index": "group-12-176", + "value": true + }, + { + "index": "group-12-177", + "value": true + }, + { + "index": "group-12-178", + "value": true + }, + { + "index": "group-12-179", + "value": true + }, + { + "index": "group-12-17", + "value": true + }, + { + "index": "group-12-180", + "value": true + }, + { + "index": "group-12-181", + "value": true + }, + { + "index": "group-12-182", + "value": true + }, + { + "index": "group-12-183", + "value": true + }, + { + "index": "group-12-184", + "value": true + }, + { + "index": "group-12-185", + "value": true + }, + { + "index": "group-12-186", + "value": true + }, + { + "index": "group-12-187", + "value": true + }, + { + "index": "group-12-188", + "value": true + }, + { + "index": "group-12-189", + "value": true + }, + { + "index": "group-12-18", + "value": true + }, + { + "index": "group-12-190", + "value": true + }, + { + "index": "group-12-191", + "value": true + }, + { + "index": "group-12-192", + "value": true + }, + { + "index": "group-12-193", + "value": true + }, + { + "index": "group-12-194", + "value": true + }, + { + "index": "group-12-195", + "value": true + }, + { + "index": "group-12-196", + "value": true + }, + { + "index": "group-12-197", + "value": true + }, + { + "index": "group-12-198", + "value": true + }, + { + "index": "group-12-199", + "value": true + }, + { + "index": "group-12-19", + "value": true + }, + { + "index": "group-12-200", + "value": true + }, + { + "index": "group-12-201", + "value": true + }, + { + "index": "group-12-202", + "value": true + }, + { + "index": "group-12-203", + "value": true + }, + { + "index": "group-12-204", + "value": true + }, + { + "index": "group-12-205", + "value": true + }, + { + "index": "group-12-206", + "value": true + }, + { + "index": "group-12-207", + "value": true + }, + { + "index": "group-12-208", + "value": true + }, + { + "index": "group-12-209", + "value": true + }, + { + "index": "group-12-20", + "value": true + }, + { + "index": "group-12-210", + "value": true + }, + { + "index": "group-12-211", + "value": true + }, + { + "index": "group-12-212", + "value": true + }, + { + "index": "group-12-213", + "value": true + }, + { + "index": "group-12-214", + "value": true + }, + { + "index": "group-12-215", + "value": true + }, + { + "index": "group-12-216", + "value": true + }, + { + "index": "group-12-217", + "value": true + }, + { + "index": "group-12-218", + "value": true + }, + { + "index": "group-12-219", + "value": true + }, + { + "index": "group-12-21", + "value": true + }, + { + "index": "group-12-220", + "value": true + }, + { + "index": "group-12-221", + "value": true + }, + { + "index": "group-12-222", + "value": true + }, + { + "index": "group-12-223", + "value": true + }, + { + "index": "group-12-224", + "value": true + }, + { + "index": "group-12-225", + "value": true + }, + { + "index": "group-12-226", + "value": true + }, + { + "index": "group-12-227", + "value": true + }, + { + "index": "group-12-228", + "value": true + }, + { + "index": "group-12-229", + "value": true + }, + { + "index": "group-12-22", + "value": true + }, + { + "index": "group-12-230", + "value": true + }, + { + "index": "group-12-231", + "value": true + }, + { + "index": "group-12-232", + "value": true + }, + { + "index": "group-12-233", + "value": true + }, + { + "index": "group-12-234", + "value": true + }, + { + "index": "group-12-235", + "value": true + }, + { + "index": "group-12-236", + "value": true + }, + { + "index": "group-12-237", + "value": true + }, + { + "index": "group-12-238", + "value": true + }, + { + "index": "group-12-239", + "value": true + }, + { + "index": "group-12-23", + "value": true + }, + { + "index": "group-12-240", + "value": true + }, + { + "index": "group-12-241", + "value": true + }, + { + "index": "group-12-242", + "value": true + }, + { + "index": "group-12-243", + "value": true + }, + { + "index": "group-12-244", + "value": true + }, + { + "index": "group-12-245", + "value": true + }, + { + "index": "group-12-246", + "value": true + }, + { + "index": "group-12-247", + "value": true + }, + { + "index": "group-12-248", + "value": true + }, + { + "index": "group-12-249", + "value": true + }, + { + "index": "group-12-24", + "value": true + }, + { + "index": "group-12-250", + "value": true + }, + { + "index": "group-12-251", + "value": true + }, + { + "index": "group-12-252", + "value": true + }, + { + "index": "group-12-253", + "value": true + }, + { + "index": "group-12-254", + "value": true + }, + { + "index": "group-12-255", + "value": true + }, + { + "index": "group-12-25", + "value": true + }, + { + "index": "group-12-26", + "value": true + }, + { + "index": "group-12-27", + "value": true + }, + { + "index": "group-12-28", + "value": true + }, + { + "index": "group-12-29", + "value": true + }, + { + "index": "group-12-30", + "value": true + }, + { + "index": "group-12-31", + "value": true + }, + { + "index": "group-12-32", + "value": true + }, + { + "index": "group-12-33", + "value": true + }, + { + "index": "group-12-34", + "value": true + }, + { + "index": "group-12-35", + "value": true + }, + { + "index": "group-12-36", + "value": true + }, + { + "index": "group-12-37", + "value": true + }, + { + "index": "group-12-38", + "value": true + }, + { + "index": "group-12-39", + "value": true + }, + { + "index": "group-12-40", + "value": true + }, + { + "index": "group-12-41", + "value": true + }, + { + "index": "group-12-42", + "value": true + }, + { + "index": "group-12-43", + "value": true + }, + { + "index": "group-12-44", + "value": true + }, + { + "index": "group-12-45", + "value": true + }, + { + "index": "group-12-46", + "value": true + }, + { + "index": "group-12-47", + "value": true + }, + { + "index": "group-12-48", + "value": true + }, + { + "index": "group-12-49", + "value": true + }, + { + "index": "group-12-50", + "value": true + }, + { + "index": "group-12-51", + "value": true + }, + { + "index": "group-12-52", + "value": true + }, + { + "index": "group-12-53", + "value": true + }, + { + "index": "group-12-54", + "value": true + }, + { + "index": "group-12-55", + "value": true + }, + { + "index": "group-12-56", + "value": true + }, + { + "index": "group-12-57", + "value": true + }, + { + "index": "group-12-58", + "value": true + }, + { + "index": "group-12-59", + "value": true + }, + { + "index": "group-12-60", + "value": true + }, + { + "index": "group-12-61", + "value": true + }, + { + "index": "group-12-62", + "value": true + }, + { + "index": "group-12-63", + "value": true + }, + { + "index": "group-12-64", + "value": true + }, + { + "index": "group-12-65", + "value": true + }, + { + "index": "group-12-66", + "value": true + }, + { + "index": "group-12-67", + "value": true + }, + { + "index": "group-12-68", + "value": true + }, + { + "index": "group-12-69", + "value": true + }, + { + "index": "group-12-70", + "value": true + }, + { + "index": "group-12-71", + "value": true + }, + { + "index": "group-12-72", + "value": true + }, + { + "index": "group-12-73", + "value": true + }, + { + "index": "group-12-74", + "value": true + }, + { + "index": "group-12-75", + "value": true + }, + { + "index": "group-12-76", + "value": true + }, + { + "index": "group-12-77", + "value": true + }, + { + "index": "group-12-78", + "value": true + }, + { + "index": "group-12-79", + "value": true + }, + { + "index": "group-12-80", + "value": true + }, + { + "index": "group-12-81", + "value": true + }, + { + "index": "group-12-82", + "value": true + }, + { + "index": "group-12-83", + "value": true + }, + { + "index": "group-12-84", + "value": true + }, + { + "index": "group-12-85", + "value": true + }, + { + "index": "group-12-86", + "value": true + }, + { + "index": "group-12-87", + "value": true + }, + { + "index": "group-12-88", + "value": true + }, + { + "index": "group-12-89", + "value": true + }, + { + "index": "group-12-90", + "value": true + }, + { + "index": "group-12-91", + "value": true + }, + { + "index": "group-12-92", + "value": true + }, + { + "index": "group-12-93", + "value": true + }, + { + "index": "group-12-94", + "value": true + }, + { + "index": "group-12-95", + "value": true + }, + { + "index": "group-12-96", + "value": true + }, + { + "index": "group-12-97", + "value": true + }, + { + "index": "group-12-98", + "value": true + }, + { + "index": "group-12-99", + "value": true + } + ] +} diff --git a/src/test/resources/cfe_12/group-12_indexes.json b/src/test/resources/cfe_12/group-12_indexes.json new file mode 100644 index 0000000..df74834 --- /dev/null +++ b/src/test/resources/cfe_12/group-12_indexes.json @@ -0,0 +1,43 @@ +{ + "nomatch": "unknown", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "cpu" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "cpu" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "memory" + }, + { + "index": "7ee85a32-vmstat", + "value": "memory" + }, + { + "index": "124f76f0-net", + "value": "network" + }, + { + "index": "8411b757-fs-block", + "value": "storage" + }, + { + "index": "dd731d68-fs-inode", + "value": "storage" + }, + { + "index": "afe23b85-io", + "value": "storage" + }, + { + "index": "62a28466-pid-disk", + "value": "storage" + } + ], + "type": "string", + "version": 1 +} diff --git a/src/test/resources/cfe_12/group-12_sourcetypes.json b/src/test/resources/cfe_12/group-12_sourcetypes.json new file mode 100644 index 0000000..9a2148f --- /dev/null +++ b/src/test/resources/cfe_12/group-12_sourcetypes.json @@ -0,0 +1,43 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "teragrep:mon:cpu_log:0" + }, + { + "index": "124f76f0-net", + "value": "teragrep:mon:net_log:0" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "teragrep:mon:pid-page-memory_log:0" + }, + { + "index": "62a28466-pid-disk", + "value": "teragrep:mon:pid-disk_log:0" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "teragrep:mon:pid-cpu_log:0" + }, + { + "index": "7ee85a32-vmstat", + "value": "teragrep:mon:vmstat_log:0" + }, + { + "index": "8411b757-fs-block", + "value": "teragrep:mon:fs-block_log:0" + }, + { + "index": "afe23b85-io", + "value": "teragrep:mon:io_log:0" + }, + { + "index": "dd731d68-fs-inode", + "value": "teragrep:mon:fs-inode_log:0" + } + ] +} diff --git a/src/test/resources/cfe_12/group-13_hosts.json b/src/test/resources/cfe_12/group-13_hosts.json new file mode 100644 index 0000000..b0a93a9 --- /dev/null +++ b/src/test/resources/cfe_12/group-13_hosts.json @@ -0,0 +1,991 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-13-100", + "value": true + }, + { + "index": "group-13-101", + "value": true + }, + { + "index": "group-13-102", + "value": true + }, + { + "index": "group-13-103", + "value": true + }, + { + "index": "group-13-104", + "value": true + }, + { + "index": "group-13-105", + "value": true + }, + { + "index": "group-13-106", + "value": true + }, + { + "index": "group-13-107", + "value": true + }, + { + "index": "group-13-108", + "value": true + }, + { + "index": "group-13-109", + "value": true + }, + { + "index": "group-13-10", + "value": true + }, + { + "index": "group-13-110", + "value": true + }, + { + "index": "group-13-111", + "value": true + }, + { + "index": "group-13-112", + "value": true + }, + { + "index": "group-13-113", + "value": true + }, + { + "index": "group-13-114", + "value": true + }, + { + "index": "group-13-115", + "value": true + }, + { + "index": "group-13-116", + "value": true + }, + { + "index": "group-13-117", + "value": true + }, + { + "index": "group-13-118", + "value": true + }, + { + "index": "group-13-119", + "value": true + }, + { + "index": "group-13-11", + "value": true + }, + { + "index": "group-13-120", + "value": true + }, + { + "index": "group-13-121", + "value": true + }, + { + "index": "group-13-122", + "value": true + }, + { + "index": "group-13-123", + "value": true + }, + { + "index": "group-13-124", + "value": true + }, + { + "index": "group-13-125", + "value": true + }, + { + "index": "group-13-126", + "value": true + }, + { + "index": "group-13-127", + "value": true + }, + { + "index": "group-13-128", + "value": true + }, + { + "index": "group-13-129", + "value": true + }, + { + "index": "group-13-12", + "value": true + }, + { + "index": "group-13-130", + "value": true + }, + { + "index": "group-13-131", + "value": true + }, + { + "index": "group-13-132", + "value": true + }, + { + "index": "group-13-133", + "value": true + }, + { + "index": "group-13-134", + "value": true + }, + { + "index": "group-13-135", + "value": true + }, + { + "index": "group-13-136", + "value": true + }, + { + "index": "group-13-137", + "value": true + }, + { + "index": "group-13-138", + "value": true + }, + { + "index": "group-13-139", + "value": true + }, + { + "index": "group-13-13", + "value": true + }, + { + "index": "group-13-140", + "value": true + }, + { + "index": "group-13-141", + "value": true + }, + { + "index": "group-13-142", + "value": true + }, + { + "index": "group-13-143", + "value": true + }, + { + "index": "group-13-144", + "value": true + }, + { + "index": "group-13-145", + "value": true + }, + { + "index": "group-13-146", + "value": true + }, + { + "index": "group-13-147", + "value": true + }, + { + "index": "group-13-148", + "value": true + }, + { + "index": "group-13-149", + "value": true + }, + { + "index": "group-13-14", + "value": true + }, + { + "index": "group-13-150", + "value": true + }, + { + "index": "group-13-151", + "value": true + }, + { + "index": "group-13-152", + "value": true + }, + { + "index": "group-13-153", + "value": true + }, + { + "index": "group-13-154", + "value": true + }, + { + "index": "group-13-155", + "value": true + }, + { + "index": "group-13-156", + "value": true + }, + { + "index": "group-13-157", + "value": true + }, + { + "index": "group-13-158", + "value": true + }, + { + "index": "group-13-159", + "value": true + }, + { + "index": "group-13-15", + "value": true + }, + { + "index": "group-13-160", + "value": true + }, + { + "index": "group-13-161", + "value": true + }, + { + "index": "group-13-162", + "value": true + }, + { + "index": "group-13-163", + "value": true + }, + { + "index": "group-13-164", + "value": true + }, + { + "index": "group-13-165", + "value": true + }, + { + "index": "group-13-166", + "value": true + }, + { + "index": "group-13-167", + "value": true + }, + { + "index": "group-13-168", + "value": true + }, + { + "index": "group-13-169", + "value": true + }, + { + "index": "group-13-16", + "value": true + }, + { + "index": "group-13-170", + "value": true + }, + { + "index": "group-13-171", + "value": true + }, + { + "index": "group-13-172", + "value": true + }, + { + "index": "group-13-173", + "value": true + }, + { + "index": "group-13-174", + "value": true + }, + { + "index": "group-13-175", + "value": true + }, + { + "index": "group-13-176", + "value": true + }, + { + "index": "group-13-177", + "value": true + }, + { + "index": "group-13-178", + "value": true + }, + { + "index": "group-13-179", + "value": true + }, + { + "index": "group-13-17", + "value": true + }, + { + "index": "group-13-180", + "value": true + }, + { + "index": "group-13-181", + "value": true + }, + { + "index": "group-13-182", + "value": true + }, + { + "index": "group-13-183", + "value": true + }, + { + "index": "group-13-184", + "value": true + }, + { + "index": "group-13-185", + "value": true + }, + { + "index": "group-13-186", + "value": true + }, + { + "index": "group-13-187", + "value": true + }, + { + "index": "group-13-188", + "value": true + }, + { + "index": "group-13-189", + "value": true + }, + { + "index": "group-13-18", + "value": true + }, + { + "index": "group-13-190", + "value": true + }, + { + "index": "group-13-191", + "value": true + }, + { + "index": "group-13-192", + "value": true + }, + { + "index": "group-13-193", + "value": true + }, + { + "index": "group-13-194", + "value": true + }, + { + "index": "group-13-195", + "value": true + }, + { + "index": "group-13-196", + "value": true + }, + { + "index": "group-13-197", + "value": true + }, + { + "index": "group-13-198", + "value": true + }, + { + "index": "group-13-199", + "value": true + }, + { + "index": "group-13-19", + "value": true + }, + { + "index": "group-13-200", + "value": true + }, + { + "index": "group-13-201", + "value": true + }, + { + "index": "group-13-202", + "value": true + }, + { + "index": "group-13-203", + "value": true + }, + { + "index": "group-13-204", + "value": true + }, + { + "index": "group-13-205", + "value": true + }, + { + "index": "group-13-206", + "value": true + }, + { + "index": "group-13-207", + "value": true + }, + { + "index": "group-13-208", + "value": true + }, + { + "index": "group-13-209", + "value": true + }, + { + "index": "group-13-20", + "value": true + }, + { + "index": "group-13-210", + "value": true + }, + { + "index": "group-13-211", + "value": true + }, + { + "index": "group-13-212", + "value": true + }, + { + "index": "group-13-213", + "value": true + }, + { + "index": "group-13-214", + "value": true + }, + { + "index": "group-13-215", + "value": true + }, + { + "index": "group-13-216", + "value": true + }, + { + "index": "group-13-217", + "value": true + }, + { + "index": "group-13-218", + "value": true + }, + { + "index": "group-13-219", + "value": true + }, + { + "index": "group-13-21", + "value": true + }, + { + "index": "group-13-220", + "value": true + }, + { + "index": "group-13-221", + "value": true + }, + { + "index": "group-13-222", + "value": true + }, + { + "index": "group-13-223", + "value": true + }, + { + "index": "group-13-224", + "value": true + }, + { + "index": "group-13-225", + "value": true + }, + { + "index": "group-13-226", + "value": true + }, + { + "index": "group-13-227", + "value": true + }, + { + "index": "group-13-228", + "value": true + }, + { + "index": "group-13-229", + "value": true + }, + { + "index": "group-13-22", + "value": true + }, + { + "index": "group-13-230", + "value": true + }, + { + "index": "group-13-231", + "value": true + }, + { + "index": "group-13-232", + "value": true + }, + { + "index": "group-13-233", + "value": true + }, + { + "index": "group-13-234", + "value": true + }, + { + "index": "group-13-235", + "value": true + }, + { + "index": "group-13-236", + "value": true + }, + { + "index": "group-13-237", + "value": true + }, + { + "index": "group-13-238", + "value": true + }, + { + "index": "group-13-239", + "value": true + }, + { + "index": "group-13-23", + "value": true + }, + { + "index": "group-13-240", + "value": true + }, + { + "index": "group-13-241", + "value": true + }, + { + "index": "group-13-242", + "value": true + }, + { + "index": "group-13-243", + "value": true + }, + { + "index": "group-13-244", + "value": true + }, + { + "index": "group-13-245", + "value": true + }, + { + "index": "group-13-246", + "value": true + }, + { + "index": "group-13-247", + "value": true + }, + { + "index": "group-13-248", + "value": true + }, + { + "index": "group-13-249", + "value": true + }, + { + "index": "group-13-24", + "value": true + }, + { + "index": "group-13-250", + "value": true + }, + { + "index": "group-13-251", + "value": true + }, + { + "index": "group-13-252", + "value": true + }, + { + "index": "group-13-253", + "value": true + }, + { + "index": "group-13-254", + "value": true + }, + { + "index": "group-13-255", + "value": true + }, + { + "index": "group-13-25", + "value": true + }, + { + "index": "group-13-26", + "value": true + }, + { + "index": "group-13-27", + "value": true + }, + { + "index": "group-13-28", + "value": true + }, + { + "index": "group-13-29", + "value": true + }, + { + "index": "group-13-30", + "value": true + }, + { + "index": "group-13-31", + "value": true + }, + { + "index": "group-13-32", + "value": true + }, + { + "index": "group-13-33", + "value": true + }, + { + "index": "group-13-34", + "value": true + }, + { + "index": "group-13-35", + "value": true + }, + { + "index": "group-13-36", + "value": true + }, + { + "index": "group-13-37", + "value": true + }, + { + "index": "group-13-38", + "value": true + }, + { + "index": "group-13-39", + "value": true + }, + { + "index": "group-13-40", + "value": true + }, + { + "index": "group-13-41", + "value": true + }, + { + "index": "group-13-42", + "value": true + }, + { + "index": "group-13-43", + "value": true + }, + { + "index": "group-13-44", + "value": true + }, + { + "index": "group-13-45", + "value": true + }, + { + "index": "group-13-46", + "value": true + }, + { + "index": "group-13-47", + "value": true + }, + { + "index": "group-13-48", + "value": true + }, + { + "index": "group-13-49", + "value": true + }, + { + "index": "group-13-50", + "value": true + }, + { + "index": "group-13-51", + "value": true + }, + { + "index": "group-13-52", + "value": true + }, + { + "index": "group-13-53", + "value": true + }, + { + "index": "group-13-54", + "value": true + }, + { + "index": "group-13-55", + "value": true + }, + { + "index": "group-13-56", + "value": true + }, + { + "index": "group-13-57", + "value": true + }, + { + "index": "group-13-58", + "value": true + }, + { + "index": "group-13-59", + "value": true + }, + { + "index": "group-13-60", + "value": true + }, + { + "index": "group-13-61", + "value": true + }, + { + "index": "group-13-62", + "value": true + }, + { + "index": "group-13-63", + "value": true + }, + { + "index": "group-13-64", + "value": true + }, + { + "index": "group-13-65", + "value": true + }, + { + "index": "group-13-66", + "value": true + }, + { + "index": "group-13-67", + "value": true + }, + { + "index": "group-13-68", + "value": true + }, + { + "index": "group-13-69", + "value": true + }, + { + "index": "group-13-70", + "value": true + }, + { + "index": "group-13-71", + "value": true + }, + { + "index": "group-13-72", + "value": true + }, + { + "index": "group-13-73", + "value": true + }, + { + "index": "group-13-74", + "value": true + }, + { + "index": "group-13-75", + "value": true + }, + { + "index": "group-13-76", + "value": true + }, + { + "index": "group-13-77", + "value": true + }, + { + "index": "group-13-78", + "value": true + }, + { + "index": "group-13-79", + "value": true + }, + { + "index": "group-13-80", + "value": true + }, + { + "index": "group-13-81", + "value": true + }, + { + "index": "group-13-82", + "value": true + }, + { + "index": "group-13-83", + "value": true + }, + { + "index": "group-13-84", + "value": true + }, + { + "index": "group-13-85", + "value": true + }, + { + "index": "group-13-86", + "value": true + }, + { + "index": "group-13-87", + "value": true + }, + { + "index": "group-13-88", + "value": true + }, + { + "index": "group-13-89", + "value": true + }, + { + "index": "group-13-90", + "value": true + }, + { + "index": "group-13-91", + "value": true + }, + { + "index": "group-13-92", + "value": true + }, + { + "index": "group-13-93", + "value": true + }, + { + "index": "group-13-94", + "value": true + }, + { + "index": "group-13-95", + "value": true + }, + { + "index": "group-13-96", + "value": true + }, + { + "index": "group-13-97", + "value": true + }, + { + "index": "group-13-98", + "value": true + }, + { + "index": "group-13-99", + "value": true + } + ] +} diff --git a/src/test/resources/cfe_12/group-13_indexes.json b/src/test/resources/cfe_12/group-13_indexes.json new file mode 100644 index 0000000..df74834 --- /dev/null +++ b/src/test/resources/cfe_12/group-13_indexes.json @@ -0,0 +1,43 @@ +{ + "nomatch": "unknown", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "cpu" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "cpu" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "memory" + }, + { + "index": "7ee85a32-vmstat", + "value": "memory" + }, + { + "index": "124f76f0-net", + "value": "network" + }, + { + "index": "8411b757-fs-block", + "value": "storage" + }, + { + "index": "dd731d68-fs-inode", + "value": "storage" + }, + { + "index": "afe23b85-io", + "value": "storage" + }, + { + "index": "62a28466-pid-disk", + "value": "storage" + } + ], + "type": "string", + "version": 1 +} diff --git a/src/test/resources/cfe_12/group-13_sourcetypes.json b/src/test/resources/cfe_12/group-13_sourcetypes.json new file mode 100644 index 0000000..9a2148f --- /dev/null +++ b/src/test/resources/cfe_12/group-13_sourcetypes.json @@ -0,0 +1,43 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "teragrep:mon:cpu_log:0" + }, + { + "index": "124f76f0-net", + "value": "teragrep:mon:net_log:0" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "teragrep:mon:pid-page-memory_log:0" + }, + { + "index": "62a28466-pid-disk", + "value": "teragrep:mon:pid-disk_log:0" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "teragrep:mon:pid-cpu_log:0" + }, + { + "index": "7ee85a32-vmstat", + "value": "teragrep:mon:vmstat_log:0" + }, + { + "index": "8411b757-fs-block", + "value": "teragrep:mon:fs-block_log:0" + }, + { + "index": "afe23b85-io", + "value": "teragrep:mon:io_log:0" + }, + { + "index": "dd731d68-fs-inode", + "value": "teragrep:mon:fs-inode_log:0" + } + ] +} diff --git a/src/test/resources/cfe_12/group-14_hosts.json b/src/test/resources/cfe_12/group-14_hosts.json new file mode 100644 index 0000000..8316a55 --- /dev/null +++ b/src/test/resources/cfe_12/group-14_hosts.json @@ -0,0 +1,71 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "group-14-10", + "value": true + }, + { + "index": "group-14-11", + "value": true + }, + { + "index": "group-14-12", + "value": true + }, + { + "index": "group-14-13", + "value": true + }, + { + "index": "group-14-14", + "value": true + }, + { + "index": "group-14-15", + "value": true + }, + { + "index": "group-14-16", + "value": true + }, + { + "index": "group-14-17", + "value": true + }, + { + "index": "group-14-18", + "value": true + }, + { + "index": "group-14-19", + "value": true + }, + { + "index": "group-14-20", + "value": true + }, + { + "index": "group-14-21", + "value": true + }, + { + "index": "group-14-22", + "value": true + }, + { + "index": "group-14-23", + "value": true + }, + { + "index": "group-14-24", + "value": true + }, + { + "index": "group-14-25", + "value": true + } + ] +} diff --git a/src/test/resources/cfe_12/group-14_indexes.json b/src/test/resources/cfe_12/group-14_indexes.json new file mode 100644 index 0000000..df74834 --- /dev/null +++ b/src/test/resources/cfe_12/group-14_indexes.json @@ -0,0 +1,43 @@ +{ + "nomatch": "unknown", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "cpu" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "cpu" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "memory" + }, + { + "index": "7ee85a32-vmstat", + "value": "memory" + }, + { + "index": "124f76f0-net", + "value": "network" + }, + { + "index": "8411b757-fs-block", + "value": "storage" + }, + { + "index": "dd731d68-fs-inode", + "value": "storage" + }, + { + "index": "afe23b85-io", + "value": "storage" + }, + { + "index": "62a28466-pid-disk", + "value": "storage" + } + ], + "type": "string", + "version": 1 +} diff --git a/src/test/resources/cfe_12/group-14_sourcetypes.json b/src/test/resources/cfe_12/group-14_sourcetypes.json new file mode 100644 index 0000000..9a2148f --- /dev/null +++ b/src/test/resources/cfe_12/group-14_sourcetypes.json @@ -0,0 +1,43 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "0ff11b44-cpu", + "value": "teragrep:mon:cpu_log:0" + }, + { + "index": "124f76f0-net", + "value": "teragrep:mon:net_log:0" + }, + { + "index": "5a67ffae-pid-page-memory", + "value": "teragrep:mon:pid-page-memory_log:0" + }, + { + "index": "62a28466-pid-disk", + "value": "teragrep:mon:pid-disk_log:0" + }, + { + "index": "75c32eb2-pid-cpu", + "value": "teragrep:mon:pid-cpu_log:0" + }, + { + "index": "7ee85a32-vmstat", + "value": "teragrep:mon:vmstat_log:0" + }, + { + "index": "8411b757-fs-block", + "value": "teragrep:mon:fs-block_log:0" + }, + { + "index": "afe23b85-io", + "value": "teragrep:mon:io_log:0" + }, + { + "index": "dd731d68-fs-inode", + "value": "teragrep:mon:fs-inode_log:0" + } + ] +} diff --git a/src/test/resources/cfe_12/test-data_hosts.json b/src/test/resources/cfe_12/test-data_hosts.json new file mode 100644 index 0000000..37a4b37 --- /dev/null +++ b/src/test/resources/cfe_12/test-data_hosts.json @@ -0,0 +1,1031 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "example-test-host", + "value": true + }, + { + "index": "group-14-1", + "value": true + }, + { + "index": "group-14-10", + "value": true + }, + { + "index": "group-14-100", + "value": true + }, + { + "index": "group-14-101", + "value": true + }, + { + "index": "group-14-102", + "value": true + }, + { + "index": "group-14-103", + "value": true + }, + { + "index": "group-14-104", + "value": true + }, + { + "index": "group-14-105", + "value": true + }, + { + "index": "group-14-106", + "value": true + }, + { + "index": "group-14-107", + "value": true + }, + { + "index": "group-14-108", + "value": true + }, + { + "index": "group-14-109", + "value": true + }, + { + "index": "group-14-11", + "value": true + }, + { + "index": "group-14-110", + "value": true + }, + { + "index": "group-14-111", + "value": true + }, + { + "index": "group-14-112", + "value": true + }, + { + "index": "group-14-113", + "value": true + }, + { + "index": "group-14-114", + "value": true + }, + { + "index": "group-14-115", + "value": true + }, + { + "index": "group-14-116", + "value": true + }, + { + "index": "group-14-117", + "value": true + }, + { + "index": "group-14-118", + "value": true + }, + { + "index": "group-14-119", + "value": true + }, + { + "index": "group-14-12", + "value": true + }, + { + "index": "group-14-120", + "value": true + }, + { + "index": "group-14-121", + "value": true + }, + { + "index": "group-14-122", + "value": true + }, + { + "index": "group-14-123", + "value": true + }, + { + "index": "group-14-124", + "value": true + }, + { + "index": "group-14-125", + "value": true + }, + { + "index": "group-14-126", + "value": true + }, + { + "index": "group-14-127", + "value": true + }, + { + "index": "group-14-128", + "value": true + }, + { + "index": "group-14-129", + "value": true + }, + { + "index": "group-14-13", + "value": true + }, + { + "index": "group-14-130", + "value": true + }, + { + "index": "group-14-131", + "value": true + }, + { + "index": "group-14-132", + "value": true + }, + { + "index": "group-14-133", + "value": true + }, + { + "index": "group-14-134", + "value": true + }, + { + "index": "group-14-135", + "value": true + }, + { + "index": "group-14-136", + "value": true + }, + { + "index": "group-14-137", + "value": true + }, + { + "index": "group-14-138", + "value": true + }, + { + "index": "group-14-139", + "value": true + }, + { + "index": "group-14-14", + "value": true + }, + { + "index": "group-14-140", + "value": true + }, + { + "index": "group-14-141", + "value": true + }, + { + "index": "group-14-142", + "value": true + }, + { + "index": "group-14-143", + "value": true + }, + { + "index": "group-14-144", + "value": true + }, + { + "index": "group-14-145", + "value": true + }, + { + "index": "group-14-146", + "value": true + }, + { + "index": "group-14-147", + "value": true + }, + { + "index": "group-14-148", + "value": true + }, + { + "index": "group-14-149", + "value": true + }, + { + "index": "group-14-15", + "value": true + }, + { + "index": "group-14-150", + "value": true + }, + { + "index": "group-14-151", + "value": true + }, + { + "index": "group-14-152", + "value": true + }, + { + "index": "group-14-153", + "value": true + }, + { + "index": "group-14-154", + "value": true + }, + { + "index": "group-14-155", + "value": true + }, + { + "index": "group-14-156", + "value": true + }, + { + "index": "group-14-157", + "value": true + }, + { + "index": "group-14-158", + "value": true + }, + { + "index": "group-14-159", + "value": true + }, + { + "index": "group-14-16", + "value": true + }, + { + "index": "group-14-160", + "value": true + }, + { + "index": "group-14-161", + "value": true + }, + { + "index": "group-14-162", + "value": true + }, + { + "index": "group-14-163", + "value": true + }, + { + "index": "group-14-164", + "value": true + }, + { + "index": "group-14-165", + "value": true + }, + { + "index": "group-14-166", + "value": true + }, + { + "index": "group-14-167", + "value": true + }, + { + "index": "group-14-168", + "value": true + }, + { + "index": "group-14-169", + "value": true + }, + { + "index": "group-14-17", + "value": true + }, + { + "index": "group-14-170", + "value": true + }, + { + "index": "group-14-171", + "value": true + }, + { + "index": "group-14-172", + "value": true + }, + { + "index": "group-14-173", + "value": true + }, + { + "index": "group-14-174", + "value": true + }, + { + "index": "group-14-175", + "value": true + }, + { + "index": "group-14-176", + "value": true + }, + { + "index": "group-14-177", + "value": true + }, + { + "index": "group-14-178", + "value": true + }, + { + "index": "group-14-179", + "value": true + }, + { + "index": "group-14-18", + "value": true + }, + { + "index": "group-14-180", + "value": true + }, + { + "index": "group-14-181", + "value": true + }, + { + "index": "group-14-182", + "value": true + }, + { + "index": "group-14-183", + "value": true + }, + { + "index": "group-14-184", + "value": true + }, + { + "index": "group-14-185", + "value": true + }, + { + "index": "group-14-186", + "value": true + }, + { + "index": "group-14-187", + "value": true + }, + { + "index": "group-14-188", + "value": true + }, + { + "index": "group-14-189", + "value": true + }, + { + "index": "group-14-19", + "value": true + }, + { + "index": "group-14-190", + "value": true + }, + { + "index": "group-14-191", + "value": true + }, + { + "index": "group-14-192", + "value": true + }, + { + "index": "group-14-193", + "value": true + }, + { + "index": "group-14-194", + "value": true + }, + { + "index": "group-14-195", + "value": true + }, + { + "index": "group-14-196", + "value": true + }, + { + "index": "group-14-197", + "value": true + }, + { + "index": "group-14-198", + "value": true + }, + { + "index": "group-14-199", + "value": true + }, + { + "index": "group-14-2", + "value": true + }, + { + "index": "group-14-20", + "value": true + }, + { + "index": "group-14-200", + "value": true + }, + { + "index": "group-14-201", + "value": true + }, + { + "index": "group-14-202", + "value": true + }, + { + "index": "group-14-203", + "value": true + }, + { + "index": "group-14-204", + "value": true + }, + { + "index": "group-14-205", + "value": true + }, + { + "index": "group-14-206", + "value": true + }, + { + "index": "group-14-207", + "value": true + }, + { + "index": "group-14-208", + "value": true + }, + { + "index": "group-14-209", + "value": true + }, + { + "index": "group-14-21", + "value": true + }, + { + "index": "group-14-210", + "value": true + }, + { + "index": "group-14-211", + "value": true + }, + { + "index": "group-14-212", + "value": true + }, + { + "index": "group-14-213", + "value": true + }, + { + "index": "group-14-214", + "value": true + }, + { + "index": "group-14-215", + "value": true + }, + { + "index": "group-14-216", + "value": true + }, + { + "index": "group-14-217", + "value": true + }, + { + "index": "group-14-218", + "value": true + }, + { + "index": "group-14-219", + "value": true + }, + { + "index": "group-14-22", + "value": true + }, + { + "index": "group-14-220", + "value": true + }, + { + "index": "group-14-221", + "value": true + }, + { + "index": "group-14-222", + "value": true + }, + { + "index": "group-14-223", + "value": true + }, + { + "index": "group-14-224", + "value": true + }, + { + "index": "group-14-225", + "value": true + }, + { + "index": "group-14-226", + "value": true + }, + { + "index": "group-14-227", + "value": true + }, + { + "index": "group-14-228", + "value": true + }, + { + "index": "group-14-229", + "value": true + }, + { + "index": "group-14-23", + "value": true + }, + { + "index": "group-14-230", + "value": true + }, + { + "index": "group-14-231", + "value": true + }, + { + "index": "group-14-232", + "value": true + }, + { + "index": "group-14-233", + "value": true + }, + { + "index": "group-14-234", + "value": true + }, + { + "index": "group-14-235", + "value": true + }, + { + "index": "group-14-236", + "value": true + }, + { + "index": "group-14-237", + "value": true + }, + { + "index": "group-14-238", + "value": true + }, + { + "index": "group-14-239", + "value": true + }, + { + "index": "group-14-24", + "value": true + }, + { + "index": "group-14-240", + "value": true + }, + { + "index": "group-14-241", + "value": true + }, + { + "index": "group-14-242", + "value": true + }, + { + "index": "group-14-243", + "value": true + }, + { + "index": "group-14-244", + "value": true + }, + { + "index": "group-14-245", + "value": true + }, + { + "index": "group-14-246", + "value": true + }, + { + "index": "group-14-247", + "value": true + }, + { + "index": "group-14-248", + "value": true + }, + { + "index": "group-14-249", + "value": true + }, + { + "index": "group-14-25", + "value": true + }, + { + "index": "group-14-250", + "value": true + }, + { + "index": "group-14-251", + "value": true + }, + { + "index": "group-14-252", + "value": true + }, + { + "index": "group-14-253", + "value": true + }, + { + "index": "group-14-254", + "value": true + }, + { + "index": "group-14-255", + "value": true + }, + { + "index": "group-14-26", + "value": true + }, + { + "index": "group-14-27", + "value": true + }, + { + "index": "group-14-28", + "value": true + }, + { + "index": "group-14-29", + "value": true + }, + { + "index": "group-14-3", + "value": true + }, + { + "index": "group-14-30", + "value": true + }, + { + "index": "group-14-31", + "value": true + }, + { + "index": "group-14-32", + "value": true + }, + { + "index": "group-14-33", + "value": true + }, + { + "index": "group-14-34", + "value": true + }, + { + "index": "group-14-35", + "value": true + }, + { + "index": "group-14-36", + "value": true + }, + { + "index": "group-14-37", + "value": true + }, + { + "index": "group-14-38", + "value": true + }, + { + "index": "group-14-39", + "value": true + }, + { + "index": "group-14-4", + "value": true + }, + { + "index": "group-14-40", + "value": true + }, + { + "index": "group-14-41", + "value": true + }, + { + "index": "group-14-42", + "value": true + }, + { + "index": "group-14-43", + "value": true + }, + { + "index": "group-14-44", + "value": true + }, + { + "index": "group-14-45", + "value": true + }, + { + "index": "group-14-46", + "value": true + }, + { + "index": "group-14-47", + "value": true + }, + { + "index": "group-14-48", + "value": true + }, + { + "index": "group-14-49", + "value": true + }, + { + "index": "group-14-5", + "value": true + }, + { + "index": "group-14-50", + "value": true + }, + { + "index": "group-14-51", + "value": true + }, + { + "index": "group-14-52", + "value": true + }, + { + "index": "group-14-53", + "value": true + }, + { + "index": "group-14-54", + "value": true + }, + { + "index": "group-14-55", + "value": true + }, + { + "index": "group-14-56", + "value": true + }, + { + "index": "group-14-57", + "value": true + }, + { + "index": "group-14-58", + "value": true + }, + { + "index": "group-14-59", + "value": true + }, + { + "index": "group-14-6", + "value": true + }, + { + "index": "group-14-60", + "value": true + }, + { + "index": "group-14-61", + "value": true + }, + { + "index": "group-14-62", + "value": true + }, + { + "index": "group-14-63", + "value": true + }, + { + "index": "group-14-64", + "value": true + }, + { + "index": "group-14-65", + "value": true + }, + { + "index": "group-14-66", + "value": true + }, + { + "index": "group-14-67", + "value": true + }, + { + "index": "group-14-68", + "value": true + }, + { + "index": "group-14-69", + "value": true + }, + { + "index": "group-14-7", + "value": true + }, + { + "index": "group-14-70", + "value": true + }, + { + "index": "group-14-71", + "value": true + }, + { + "index": "group-14-72", + "value": true + }, + { + "index": "group-14-73", + "value": true + }, + { + "index": "group-14-74", + "value": true + }, + { + "index": "group-14-75", + "value": true + }, + { + "index": "group-14-76", + "value": true + }, + { + "index": "group-14-77", + "value": true + }, + { + "index": "group-14-78", + "value": true + }, + { + "index": "group-14-79", + "value": true + }, + { + "index": "group-14-8", + "value": true + }, + { + "index": "group-14-80", + "value": true + }, + { + "index": "group-14-81", + "value": true + }, + { + "index": "group-14-82", + "value": true + }, + { + "index": "group-14-83", + "value": true + }, + { + "index": "group-14-84", + "value": true + }, + { + "index": "group-14-85", + "value": true + }, + { + "index": "group-14-86", + "value": true + }, + { + "index": "group-14-87", + "value": true + }, + { + "index": "group-14-88", + "value": true + }, + { + "index": "group-14-89", + "value": true + }, + { + "index": "group-14-9", + "value": true + }, + { + "index": "group-14-90", + "value": true + }, + { + "index": "group-14-91", + "value": true + }, + { + "index": "group-14-92", + "value": true + }, + { + "index": "group-14-93", + "value": true + }, + { + "index": "group-14-94", + "value": true + }, + { + "index": "group-14-95", + "value": true + }, + { + "index": "group-14-96", + "value": true + }, + { + "index": "group-14-97", + "value": true + }, + { + "index": "group-14-98", + "value": true + }, + { + "index": "group-14-99", + "value": true + } + ] +} \ No newline at end of file diff --git a/src/test/resources/cfe_12/test-data_indexes.json b/src/test/resources/cfe_12/test-data_indexes.json new file mode 100644 index 0000000..8ff1e67 --- /dev/null +++ b/src/test/resources/cfe_12/test-data_indexes.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "f17", + "value": "f17" + }, + { + "index": "archiver-test", + "value": "archiver-test" + }, + { + "index": "f7a20104-flood-test.logGLOB", + "value": "flood-test" + }, + { + "index": "52da2a11-log-1.logGLOB", + "value": "log-1" + }, + { + "index": "1c30cfbb-log-2.logGLOB", + "value": "log-2" + }, + { + "index": "4ff62fd0-log-3.logGLOB", + "value": "log-3" + }, + { + "index": "cdee23c8-log-4.logGLOB", + "value": "log-4" + }, + { + "index": "logproc-pstats", + "value": "logproc-pstats" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/cfe_12/test-data_sourcetypes.json b/src/test/resources/cfe_12/test-data_sourcetypes.json new file mode 100644 index 0000000..9167278 --- /dev/null +++ b/src/test/resources/cfe_12/test-data_sourcetypes.json @@ -0,0 +1,39 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "f17", + "value": "test:f17:0" + }, + { + "index": "archiver-test", + "value": "test:archiver-test:0" + }, + { + "index": "f7a20104-flood-test.logGLOB", + "value": "test:flood-test:0" + }, + { + "index": "52da2a11-log-1.logGLOB", + "value": "test:log-1:0" + }, + { + "index": "1c30cfbb-log-2.logGLOB", + "value": "test:log-2:0" + }, + { + "index": "4ff62fd0-log-3.logGLOB", + "value": "test:log-3:0" + }, + { + "index": "cdee23c8-log-4.logGLOB", + "value": "test:log-4:0" + }, + { + "index": "logproc-pstats", + "value": "test:logproc-pstats:0" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/cfe_16/hec_hosts.json b/src/test/resources/cfe_16/hec_hosts.json new file mode 100644 index 0000000..80300c3 --- /dev/null +++ b/src/test/resources/cfe_16/hec_hosts.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "My RoutingKey having token", + "value": "my-routingkey-having-hostname.example.com" + } + ] +} diff --git a/src/test/resources/kin_02/stream-processor_hosts.json b/src/test/resources/kin_02/stream-processor_hosts.json new file mode 100644 index 0000000..7fdf0e8 --- /dev/null +++ b/src/test/resources/kin_02/stream-processor_hosts.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "1234567890", + "value": "1234567890.host.example.com" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/kin_02/stream-processor_tags.json b/src/test/resources/kin_02/stream-processor_tags.json new file mode 100644 index 0000000..6d34df5 --- /dev/null +++ b/src/test/resources/kin_02/stream-processor_tags.json @@ -0,0 +1,11 @@ +{ + "version": 1, + "nomatch": "unknown", + "type": "string", + "table": [ + { + "index": "/example/logGroupName/ThatExists", + "value": "exampleAppName" + } + ] +} \ No newline at end of file