logstash-input-faker 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 584f9d1ff3b09d9d3fd951f02d11a19197b34722
4
- data.tar.gz: 272c1c360c7e38d34a979c416bea17e946c388c5
3
+ metadata.gz: f0b0612f2fe0485a77d7f728963ab6935a145aff
4
+ data.tar.gz: 3929513729b77e4633620b2c53d7a502a08e1401
5
5
  SHA512:
6
- metadata.gz: 789b33f2a41e16ee32e6c7ec61fff8926a7a9ddfc900b013a6ab610dea91d9bc0a4af2e85e4490b455433f3c05dead41293798f6fc55707fd170f0a1c86d17b1
7
- data.tar.gz: 0197b9b78f8caae7f0993bef6ba0ccb19c3438edf6e1f4e8168eda177ebdfca4eb6a8b760670be0b64c4a46229fa165a4af83258e925c676854ab4631489318b
6
+ metadata.gz: 2f7bf726acded7384120aafbf3f89ba6e99ee854d1620a3809ba74dc051dada14fc52809d8b86a234fdb8b8e56404484a6b2dfc7e608c1fd94bb71fc33b45aaf
7
+ data.tar.gz: 5cdf793902a797cc8b7d8c9a5f1496075c5e650c0ab97ee8047ea1db5d4c2205b62700e9c4ce269635d26a9d4d143eaa8b498196ba54a8d9bd3b092b5d961a60
@@ -16,7 +16,7 @@ I18n.reload!
16
16
  # modules and method calls from the Faker gem library seen at
17
17
  # https://github.com/stympy/faker/
18
18
  # ===================================================================
19
- # Example:
19
+ # Example:
20
20
  # [source, ruby]
21
21
  # input {
22
22
  # faker {
@@ -38,11 +38,11 @@ class LogStash::Inputs::Faker < LogStash::Inputs::Base
38
38
 
39
39
 
40
40
  # Similar to LogStash::Inputs::Base.add_field define a hash
41
- # where the value is a Faker module and method call
41
+ # where the value is a Faker module and method call
42
42
  # ex: Name.first_name
43
43
  config :add_faker_field, :validate => :hash, :default => {}
44
44
 
45
- # Add a splitable field. Currently only supports defining a
45
+ # Add a splitable field. Currently only supports defining a
46
46
  # single field that will be used for generating sub-events
47
47
  config :splitable_field, :validate => :string, :default => nil
48
48
 
@@ -55,7 +55,7 @@ class LogStash::Inputs::Faker < LogStash::Inputs::Base
55
55
  config :add_splitable_faker_field, :validate => :hash, :default => {}
56
56
 
57
57
  # define the number of entries into the array of the splitable field
58
- # When set to 0 a random number will be used within 1-100 as the
58
+ # When set to 0 a random number will be used within 1-100 as the
59
59
  # splitable field count
60
60
  config :splitable_field_count, :validate => :number, default: 0
61
61
 
@@ -111,10 +111,10 @@ class LogStash::Inputs::Faker < LogStash::Inputs::Base
111
111
  @splitable_field_count.times do
112
112
  new_event = LogStash::Event.new()
113
113
  @add_splitable_faker_field.each do |field, faker_string|
114
- new_event.set(field, Faker.class_eval(faker_string))
114
+ new_event.set(field, Faker.class_eval(event.sprintf(faker_string)))
115
115
  end
116
116
  @add_splitable_field.each do |field, value|
117
- new_event.set(field, value)
117
+ new_event.set(field, event.sprintf(value))
118
118
  end
119
119
  new_event.remove("@timestamp")
120
120
  new_event.remove("@version")
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-faker'
4
- s.version = '0.2.0'
4
+ s.version = '0.2.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Generate log events with fake data"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -19,7 +19,7 @@ describe LogStash::Inputs::Faker do
19
19
  "test" => "field"
20
20
  }
21
21
  plg.add_splitable_faker_field = {
22
- "[name][testing]" => "Name.first_name"
22
+ "[name][testing]" => "Internet.user_name('%{first_name} %{last_name}', ['_'])"
23
23
  }
24
24
  plg.splitable_field_count = 10
25
25
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-faker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jsericks