You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`Include Header` - this select configures output behavior of the component. If option is `Yes` or no value chosen than header of csv file will be written to attachment, this is default behavior. If value `No` selected than csv header will be omitted from attachment.
@@ -100,8 +99,98 @@ The output of the CSV Write component will be a message with an attachment. In
100
99
order to access this attachment, the component following the CSV Write must be
101
100
able to handle file attachments.
102
101
102
+
### Write CSV attachment from JSON Object
103
+
104
+
*`Include Header` - this select configures output behavior of the component. If option is `Yes` or no value chosen than header of csv file will be written to attachment, this is default behavior. If value `No` selected than csv header will be omitted from attachment.
105
+
*`Separator` - this select configures type of CSV delimiter in an output file. There are next options: `Comma (,)`, `Semicolon (;)`, `Space ( )`, `Tab (\t)`.
106
+
107
+
This action will combine multiple incoming events into a CSV file until there is a gap
108
+
of more than 10 seconds between events. Afterwards, the CSV file will be closed
109
+
and attached to the outgoing message.
110
+
111
+
This action will convert an incoming array into a CSV file by following approach:
112
+
113
+
* Header inherits names of keys from the input message;
114
+
* Payload will store data from Values of relevant Keys (Columns);
115
+
* Undefined values of a JSON Object won't be joined to result set (`{ key: undefined }`);
116
+
* False values of a JSON Object will be represented as empty string (`{ key: false }` => `""`).
117
+
118
+
Requirements:
119
+
120
+
* The inbound message is an JSON Object;
121
+
* This JSON object has plain structure without nested levels (structured types `objects` and `arrays` are not supported as values). Only primitive types are supported: `strings`, `numbers`, `booleans` and `null`. Otherwise, the error message will be thrown: `Inbound message should be a plain Object. At least one of entries is not a primitive type`.
122
+
123
+
The keys of an input JSON will be published as the header in the first row. For each incoming
124
+
event, the value for each header will be `stringified` and written as the value
125
+
for that cell. All other properties will be ignored. For example, headers
126
+
`foo,bar` along with the following JSON events:
127
+
128
+
```
129
+
{"foo":"myfoo", "bar":"mybar"}
130
+
{"foo":"myfoo", "bar":[1,2]}
131
+
{"bar":"mybar", "baz":"mybaz"}
132
+
```
133
+
134
+
will produce the following `.csv` file:
135
+
136
+
```
137
+
foo,bar
138
+
myfoo,mybar
139
+
myfoo,"[1,2]"
140
+
,mybar
141
+
```
142
+
143
+
The output of the CSV Write component will be a message with an attachment. In
144
+
order to access this attachment, the component following the CSV Write must be
145
+
able to handle file attachments.
146
+
147
+
### Write CSV attachment from JSON Array
148
+
149
+
*`Include Header` - this select configures output behavior of the component. If option is `Yes` or no value chosen than header of csv file will be written to attachment, this is default behavior. If value `No` selected than csv header will be omitted from attachment.
150
+
*`Separator` - this select configures type of CSV delimiter in an output file. There are next options: `Comma (,)`, `Semicolon (;)`, `Space ( )`, `Tab (\t)`.
151
+
152
+
This action will convert an incoming array into a CSV file by following approach:
153
+
154
+
* Header inherits names of keys from the input message;
155
+
* Payload will store data from Values of relevant Keys (Columns);
156
+
* Undefined values of a JSON Object won't be joined to result set (`{ key: undefined }`);
157
+
* False values of a JSON Object will be represented as empty string (`{ key: false }` => `""`).
158
+
159
+
Requirements:
160
+
161
+
* The inbound message is an JSON Array of Objects with identical structure;
162
+
* Each JSON object has plain structure without nested levels (structured types `objects` and `arrays` are not supported as values). Only primitive types are supported: `strings`, `numbers`, `booleans` and `null`. Otherwise, the error message will be thrown: `Inbound message should be a plain Object. At least one of entries is not a primitive type`.
163
+
164
+
The keys of an input JSON will be published as the header in the first row. For each incoming
165
+
event, the value for each header will be `stringified` and written as the value
166
+
for that cell. All other properties will be ignored. For example, headers
167
+
`foo,bar` along with the following JSON events:
168
+
169
+
```
170
+
[
171
+
{"foo":"myfoo", "bar":"mybar"}
172
+
{"foo":"myfoo", "bar":[1,2]}
173
+
{"bar":"mybar", "baz":"mybaz"}
174
+
]
175
+
```
176
+
177
+
will produce the following `.csv` file:
178
+
179
+
```
180
+
foo,bar
181
+
myfoo,mybar
182
+
myfoo2,[1,2]"
183
+
,mybar
184
+
```
185
+
186
+
The output of the CSV Write component will be a message with an attachment. In
187
+
order to access this attachment, the component following the CSV Write must be
188
+
able to handle file attachments.
189
+
103
190
### Limitations
104
191
192
+
#### General
193
+
105
194
1. You may get `Component run out of memory and terminated.` error during run-time, that means that component needs more memory, please add
106
195
`EIO_REQUIRED_RAM_MB` environment variable with an appropriate value (e.g. value `512` means that 512 MB will be allocated) for the component in this case.
107
196
2. You may get `Error: write after end` error, as a current workaround try increase value of environment variable: `TIMEOUT_BETWEEN_EVENTS`.
"Multiple incoming events can be combined into one CSV file with the write CSV action. See https://github.com/elasticio/csv-component/ for additional documentation.",
49
55
"main": "./lib/actions/write.js",
50
56
"title": "Write CSV attachment",
57
+
"help": {
58
+
"description": "Multiple incoming events can be combined into one CSV file with the write CSV action.",
0 commit comments