Skip to content

Commit

Permalink
add data_pipelines templates (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
messixukejia authored Jul 8, 2022
1 parent 025db07 commit bb3d0ed
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 31 deletions.
2 changes: 1 addition & 1 deletion core/config_manager/ConfigYamlToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ bool ConfigYamlToJson::GenerateLocalJsonConfigForSLSFulsher(const YAML::Node& ya
bool ConfigYamlToJson::FillupDefalutUserJsonConfig(const WorkMode& workMode, Json::Value& userJsonConfig) {
if (workMode.mIsFileMode) {
if (!userJsonConfig.isMember("max_depth")) {
userJsonConfig["max_depth"] = 10;
userJsonConfig["max_depth"] = 0;
}

// To compatible with the old configuration, introduce placeholder for file mode.
Expand Down
4 changes: 2 additions & 2 deletions core/profile_sender/ProfileSender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ void ProfileSender::SendRunningStatus(sls_logs::LogGroup& logGroup) {
}

std::string region = "cn-shanghai";
std::string project = "logtail-opensource";
std::string logstore = "logtail-online";
std::string project = "ilogtail-community-edition";
std::string logstore = "ilogtail-online";
std::string endpoint = region + ".log.aliyuncs.com";

Json::Value logtailStatus;
Expand Down
34 changes: 34 additions & 0 deletions example_config/data_pipelines/file_delimiter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022 iLogtail Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enable: true
inputs:
- Type: file_log
LogPath: /home/test-dir/test_log
FilePattern: delimiter.log
processors:
- Type: processor_split_char
SourceKey: content
SplitSep: "|"
SplitKeys:
- time
- k1
- k2
flushers:
- Type: flusher_sls
Endpoint: cn-xxx.log.aliyuncs.com
ProjectName: test_project
LogstoreName: test_logstore
- Type: flusher_stdout
OnlyStdout: true
32 changes: 32 additions & 0 deletions example_config/data_pipelines/file_json.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2022 iLogtail Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enable: true
inputs:
- Type: file_log
LogPath: /home/test-dir/test_log
FilePattern: json.log
processors:
- Type: processor_json
SourceKey: content
KeepSource: false
ExpandDepth: 1
ExpandConnector: ""
flushers:
- Type: flusher_sls
Endpoint: cn-xxx.log.aliyuncs.com
ProjectName: test_project
LogstoreName: test_logstore
- Type: flusher_stdout
OnlyStdout: true
31 changes: 31 additions & 0 deletions example_config/data_pipelines/file_multiline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2022 iLogtail Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enable: true
inputs:
- Type: file_log
LogPath: /home/test-dir/test_log
FilePattern: multiline.log
processors:
- Type: processor_split_log_regex
SplitRegex: \[\d+-\d+-\d+\s\d+:\d+:\d+]\s.*
SplitKey: content
PreserveOthers: true
flushers:
- Type: flusher_sls
Endpoint: cn-xxx.log.aliyuncs.com
ProjectName: test_project
LogstoreName: test_logstore
- Type: flusher_stdout
OnlyStdout: true
33 changes: 33 additions & 0 deletions example_config/data_pipelines/file_reg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2022 iLogtail Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enable: true
inputs:
- Type: file_log
LogPath: /home/test-dir/test_log
FilePattern: reg.log
processors:
- Type: processor_regex
SourceKey: content
Regex: (\d*-\d*-\d*)\s(.*)
Keys:
- time
- msg
flushers:
- Type: flusher_sls
Endpoint: cn-xxx.log.aliyuncs.com
ProjectName: test_project
LogstoreName: test_logstore
- Type: flusher_stdout
OnlyStdout: true
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Copyright 2022 iLogtail Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enable: true
inputs:
- Type: file_log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Copyright 2022 iLogtail Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

enable: true
inputs:
- Type: service_docker_stdout
Expand Down

0 comments on commit bb3d0ed

Please sign in to comment.