fluent-plugin-azurefunctions 0.1.0 → 0.1.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 +4 -4
- data/ChangeLog.md +7 -0
- data/README.md +20 -9
- data/VERSION +1 -1
- data/examples/fluent_1.conf +0 -6
- data/img/Azure-Functions-Fluentd.png +0 -0
- data/lib/fluent/plugin/azurefunctions/client.rb +5 -3
- metadata +4 -3
- data/ChangeLog +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3110c479872af4941bd94a6cc65507068811b37b
|
4
|
+
data.tar.gz: 2c14ca72f3d95508f90828c2cf1a3c44c0e4e88e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc157e69274bd27a395cacffc9a3f219926eab95dd774b5229f3db171cfddc28120f32861d999d1f1d773ff424d34dce22fef6377c4b7599f822aa8df6431035
|
7
|
+
data.tar.gz: 08540d4ccfcc4e694d81da6337ea4a5d9799e646b51a4a6b5c2c85623a1da44ad9f0e69a2d13df983cb0677f6428509a3aa56330ec2809ad9dbfe7e0b68466ca
|
data/ChangeLog.md
ADDED
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# fluent-plugin-azurefunctions
|
2
2
|
[Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview) (HTTP Trigger) output plugin for Fluentd. The plugin aggregates semi-structured data in real-time and writes the buffered data via HTTPS request to HTTP Trigger Function.
|
3
3
|
|
4
|
+

|
5
|
+
|
6
|
+
|
4
7
|
## Installation
|
5
8
|
```
|
6
9
|
$ gem install fluent-plugin-azurefunctions
|
@@ -29,7 +32,7 @@ examples/function-csharp
|
|
29
32
|
@type azurefunctions
|
30
33
|
endpoint AZURE_FUNCTION_ENDPOINT # ex. https://<accountname>.azurewebsites.net/api/<functionname>
|
31
34
|
function_key AZURE_FUNCTION_KEY # ex. aRVQ7Lj0vzDhY0JBYF8gpxYyEBxLwhO51JSC7X5dZFbTvROs7uNg==
|
32
|
-
key_names key1,key2,key3
|
35
|
+
key_names key1,key2,key3
|
33
36
|
add_time_field true
|
34
37
|
time_field_name mytime
|
35
38
|
time_format %s
|
@@ -41,12 +44,12 @@ examples/function-csharp
|
|
41
44
|
|
42
45
|
* **endpoint (required)** - Azure Functions Endpoint URL
|
43
46
|
* **function\_key (required)** - Azure Functions API Key
|
44
|
-
* **key\_names (optional)** - Key names in
|
47
|
+
* **key\_names (optional)** - Key names in incoming records to post to Azure functions HTTP Trigger functions. Each key needs to be separated by a comma. If key_names not specified, all incoming records are posted. If incoming records contain the same key names as the ones specified in time_field_name and tag_field_name, their values are replaced by the values of time_field_name and tag_field_name
|
45
48
|
* **add\_time\_field (optional)** - Default:true. This option allows to insert a time field to record
|
46
49
|
* **time\_field\_name (optional)** - Default:time. This is required only when add_time_field is true
|
47
50
|
* **localtime (optional)** - Default:false. Time record is inserted with UTC (Coordinated Universal Time) by default. This option allows to use local time if you set localtime true. This is valid only when add_time_field is true
|
48
51
|
* **time\_format (optional)** - Default:%s. Time format for a time field to be inserted. Default format is %s, that is unix epoch time. If you want it to be more human readable, set this %Y%m%d-%H:%M:%S, for example. This is valid only when add_time_field is true.
|
49
|
-
* **add\_tag\_field (optional)** - Default:
|
52
|
+
* **add\_tag\_field (optional)** - Default:false. This option allows to insert a tag field to record
|
50
53
|
* **tag\_field\_name (optional)** - Default:tag. This is required only when add_time_field is true
|
51
54
|
|
52
55
|
|
@@ -69,14 +72,14 @@ fluent-plugin-azurefunctions adds **.rid** attribute which is UUID format and an
|
|
69
72
|
</match>
|
70
73
|
```
|
71
74
|
|
72
|
-
The plugin write all records in
|
75
|
+
The plugin write all records in incoming event stream out to Azure Functions:
|
73
76
|
```
|
74
77
|
# Generating test event using fluent-cat
|
75
|
-
echo ' { "key1":"value1", "key2":"value2", "key3":"value3"
|
78
|
+
echo ' { "key1":"value1", "key2":"value2", "key3":"value3"}' | fluent-cat azurefunctions.msg
|
76
79
|
|
77
80
|
# HTTP POST request body to Azure Functions
|
78
81
|
{
|
79
|
-
"payload": '{"key1":"value1", "key2":"value2", "key3":"value3", "
|
82
|
+
"payload": '{"key1":"value1", "key2":"value2", "key3":"value3", "time":"1479741633"}'
|
80
83
|
}
|
81
84
|
|
82
85
|
mytime=1479741633
|
@@ -107,10 +110,10 @@ mytime=1479741633
|
|
107
110
|
</match>
|
108
111
|
```
|
109
112
|
|
110
|
-
The plugin write only records that are specified by key_names in
|
113
|
+
The plugin write only records that are specified by key_names in incoming event stream out to Azure Functions:
|
111
114
|
```
|
112
115
|
# Generating test event using fluent-cat
|
113
|
-
echo ' { "key1":"value1", "key2":"value2", "key3":"value3"
|
116
|
+
echo ' { "key1":"value1", "key2":"value2", "key3":"value3"}' | fluent-cat azurefunctions.msg
|
114
117
|
|
115
118
|
# HTTP POST request body to Azure Functions
|
116
119
|
{
|
@@ -140,9 +143,17 @@ $ rake install:local
|
|
140
143
|
$ fluentd -c fluent.conf -vv &
|
141
144
|
|
142
145
|
# generate test event
|
143
|
-
$ echo ' { "key1":"value1", "key2":"value2", "key3":"value3"
|
146
|
+
$ echo ' { "key1":"value1", "key2":"value2", "key3":"value3"}' | fluent-cat azurefunctions.msg
|
144
147
|
```
|
145
148
|
|
149
|
+
## Change log
|
150
|
+
* [Changelog](ChangeLog.md)
|
151
|
+
|
152
|
+
## Links
|
153
|
+
|
154
|
+
* https://rubygems.org/gems/fluent-plugin-azurefunctions
|
155
|
+
* http://unofficialism.info/posts/fluent-plugin-azurefunctions/
|
156
|
+
|
146
157
|
## Contributing
|
147
158
|
|
148
159
|
Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/fluent-plugin-azurefunctions.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/examples/fluent_1.conf
CHANGED
@@ -15,10 +15,4 @@
|
|
15
15
|
@type azurefunctions
|
16
16
|
endpoint AZURE_FUNCTION_ENDPOINT # ex. https://<accountname>.azurewebsites.net/api/<functionname>
|
17
17
|
function_key AZURE_FUNCTION_KEY # ex. aRVQ7Lj0vzDhY0JBYF8gpxYyEBxLwhO51JSC7X5dZFbTvROs7uNg==
|
18
|
-
add_time_field true
|
19
|
-
time_field_name mytime
|
20
|
-
time_format %s
|
21
|
-
localtime true
|
22
|
-
add_tag_field true
|
23
|
-
tag_field_name mytag
|
24
18
|
</match>
|
Binary file
|
@@ -4,19 +4,21 @@ module AzureFunctions
|
|
4
4
|
require 'rest-client'
|
5
5
|
require 'json'
|
6
6
|
@endpoint = endpoint
|
7
|
-
@function_key = function_key
|
8
7
|
@headers = {
|
9
|
-
'Content-Type' => "application/json; charset=UTF-8"
|
8
|
+
'Content-Type' => "application/json; charset=UTF-8",
|
9
|
+
'x-functions-key' => function_key
|
10
10
|
}
|
11
11
|
end
|
12
12
|
|
13
13
|
def post(payload)
|
14
14
|
raise ConfigError, 'no payload' if payload.empty?
|
15
15
|
res = RestClient.post(
|
16
|
-
|
16
|
+
@endpoint,
|
17
17
|
{ :payload => payload }.to_json,
|
18
18
|
@headers)
|
19
19
|
res
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
+
|
24
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-azurefunctions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoichi Kawasaki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -94,7 +94,7 @@ extensions: []
|
|
94
94
|
extra_rdoc_files: []
|
95
95
|
files:
|
96
96
|
- ".gitignore"
|
97
|
-
- ChangeLog
|
97
|
+
- ChangeLog.md
|
98
98
|
- Gemfile
|
99
99
|
- LICENSE
|
100
100
|
- README.md
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- examples/function-csharp/run.csx
|
108
108
|
- examples/send-event.sh
|
109
109
|
- fluent-plugin-azurefunctions.gemspec
|
110
|
+
- img/Azure-Functions-Fluentd.png
|
110
111
|
- lib/fluent/plugin/azurefunctions/client.rb
|
111
112
|
- lib/fluent/plugin/out_azurefunctions.rb
|
112
113
|
- test/helper.rb
|
data/ChangeLog
DELETED