Skip to content

Commit

Permalink
Add second test case from magnusbaeck#147
Browse files Browse the repository at this point in the history
  • Loading branch information
breml committed Nov 1, 2021
1 parent bd14ec5 commit 4096149
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
3 changes: 3 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ func TestIntegration(t *testing.T) {
{
name: "issue_155",
},
{
name: "issue_147",
},
}

for _, tc := range cases {
Expand Down
2 changes: 2 additions & 0 deletions testdata/issue_147.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- pipeline.id: main
path.config: "*.conf"
45 changes: 45 additions & 0 deletions testdata/issue_147/issue_147.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
input {
file {
path => "/var/log/db_logs_logstash/*.csv"
mode => "read"
file_completed_action => "delete"
id => "file1"
tags => [ "file1" ]
}
}

input {
file {
path => "/var/log/db_logs_logstash/*.csv"
mode => "read"
file_completed_action => "delete"
id => "file2"
tags => [ "file2" ]
}
}

filter {
if "file1" in [tags] {
csv {
separator => ";"
autodetect_column_names => true
skip_empty_columns => true
id => csv1
}
}

if "file2" in [tags] {
csv {
separator => ";"
autodetect_column_names => true
skip_empty_columns => true
id => csv2
}
}
}

output {
stdout {
id => "stdout"
}
}
19 changes: 19 additions & 0 deletions testdata/testcases/issue_147/file1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
ignore:
- "@timestamp"
testcases:
- input:
- TYP_INST;DBNAME;OS_USERNAME;USERNAME;USERHOST;TERMINAL;LOGON_TIME;LOGOFF_TIME;OS_PROCESS;CLIENT_ID
- Prod;myBeautifulDB;myOS;myUsername;myUserhost;;22/08/2021 14:14:43;22/08/2021 14:14:43;4468;
expected:
- message: "Prod;myBeautifulDB;myOS;myUsername;myUserhost;;22/08/2021 14:14:43;22/08/2021 14:14:43;4468;"
TYP_INST: "Prod"
DBNAME: "myBeautifulDB"
OS_USERNAME: "myOS"
USERNAME: "myUsername"
USERHOST: "myUserhost"
LOGON_TIME: "22/08/2021 14:14:43"
LOGOFF_TIME: "22/08/2021 14:14:43"
OS_PROCESS: "4468"
tags: ["file1"]
input_plugin: file1
20 changes: 20 additions & 0 deletions testdata/testcases/issue_147/file2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
ignore:
- "@timestamp"
testcases:
- input:
- |
TYP_INST;DBNAME;OS_USERNAME;USERNAME;USERHOST;TERMINAL;LOGON_TIME;LOGOFF_TIME;OS_PROCESS;CLIENT_ID
Prod;myBeautifulDB;myOS;myUsername;myUserhost;;22/08/2021 14:14:43;22/08/2021 14:14:43;4468;
expected:
- message: "Prod;myBeautifulDB;myOS;myUsername;myUserhost;;22/08/2021 14:14:43;22/08/2021 14:14:43;4468;"
TYP_INST: "Prod"
DBNAME: "myBeautifulDB"
OS_USERNAME: "myOS"
USERNAME: "myUsername"
USERHOST: "myUserhost"
LOGON_TIME: "22/08/2021 14:14:43"
LOGOFF_TIME: "22/08/2021 14:14:43"
OS_PROCESS: "4468"
tags: ["file2"]
input_plugin: file2

0 comments on commit 4096149

Please sign in to comment.