-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back prospector.type which went missing (#4361)
It seems in one of the recent refactorings prospector.type went missing. Test added to make sure it will not go missing again.
- Loading branch information
1 parent
8fb1cf9
commit b1e44a5
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from filebeat import BaseTest | ||
import os | ||
|
||
""" | ||
Test for basic object | ||
""" | ||
|
||
|
||
class Test(BaseTest): | ||
|
||
def test_base(self): | ||
""" | ||
Test if the basic fields exist. | ||
""" | ||
self.render_config_template( | ||
path=os.path.abspath(self.working_dir) + "/test.log", | ||
) | ||
|
||
with open(self.working_dir + "/test.log", "w") as f: | ||
f.write("test message\n") | ||
|
||
filebeat = self.start_beat() | ||
self.wait_until(lambda: self.output_has(lines=1)) | ||
filebeat.check_kill_and_wait() | ||
|
||
output = self.read_output()[0] | ||
assert "@timestamp" in output | ||
assert "prospector.type" in output |