-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added plugin.id to fish tag log lines related to plugins
Fixes #11078
- Loading branch information
Showing
12 changed files
with
202 additions
and
15 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
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
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
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
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
55 changes: 55 additions & 0 deletions
55
logstash-core/src/test/java/org/logstash/config/ir/PluginConfigNameMethodDouble.java
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,55 @@ | ||
package org.logstash.config.ir; | ||
|
||
import org.jruby.Ruby; | ||
import org.jruby.RubyClass; | ||
import org.jruby.RubyObject; | ||
import org.jruby.RubyString; | ||
import org.jruby.anno.JRubyClass; | ||
import org.jruby.anno.JRubyMethod; | ||
import org.jruby.runtime.ThreadContext; | ||
import org.jruby.runtime.builtin.IRubyObject; | ||
|
||
import static org.logstash.RubyUtil.RUBY; | ||
|
||
/** | ||
* Fake class to double the Ruby's method config_name() | ||
* */ | ||
@JRubyClass(name = "PluginConfigNameMethodDouble") | ||
public class PluginConfigNameMethodDouble extends RubyObject { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
static final RubyClass RUBY_META_CLASS; | ||
private RubyString filterName; | ||
|
||
static { | ||
RUBY_META_CLASS = RUBY.defineClass("PluginConfigNameMethodDouble", RUBY.getObject(), | ||
PluginConfigNameMethodDouble::new); | ||
RUBY_META_CLASS.defineAnnotatedMethods(org.logstash.config.ir.compiler.FakeOutClass.class); | ||
} | ||
|
||
PluginConfigNameMethodDouble(final Ruby runtime, final RubyClass metaClass) { | ||
super(runtime, metaClass); | ||
} | ||
|
||
static PluginConfigNameMethodDouble create(RubyString filterName) { | ||
final PluginConfigNameMethodDouble instance = new PluginConfigNameMethodDouble(RUBY, RUBY_META_CLASS); | ||
instance.filterName = filterName; | ||
return instance; | ||
} | ||
|
||
@JRubyMethod | ||
public IRubyObject name(final ThreadContext context) { | ||
return RUBY.newString("example"); | ||
} | ||
|
||
@JRubyMethod(name = "config_name") | ||
public IRubyObject configName(final ThreadContext context, final IRubyObject recv) { | ||
return filterName; | ||
} | ||
|
||
@JRubyMethod | ||
public IRubyObject initialize(final ThreadContext context, final IRubyObject args) { | ||
return this; | ||
} | ||
} |
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,18 @@ | ||
--- | ||
services: | ||
- logstash | ||
config: |- | ||
input { | ||
generator { | ||
count => 4 | ||
} | ||
} | ||
filter { | ||
sleep { | ||
id => "sleep_filter_123" | ||
time => 1 | ||
} | ||
} | ||
output { | ||
null {} | ||
} |
Oops, something went wrong.