embulk-plugin-input-sfdc-event-log-files 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/embulk/input_sfdc_event_log_files.rb +6 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f973162321b0974a1cc1dcca261ee3be8e2d9e4e
|
4
|
+
data.tar.gz: 6768787a20145071af909e2d3f63242eefe8357f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0d3049dfcfcd0e23260769325d6358b971d976bc18dc7b1fd145ff15f530041c3bda31b30f30f4c383437dc4f62a6f447e93dbc031333ca41ac060c64f99795
|
7
|
+
data.tar.gz: bb6b96b8c4b21fbdb8807dd82bec0ee6b9fd6ff509a962f07d5047ffd97f161dd0ba4afa101547303150a1f25a3d6997ceed4d547dfd7a5a2e2e50e021a15395
|
data/README.md
CHANGED
@@ -3,6 +3,6 @@ embulk-plugin-input-sfdc-event-log-files
|
|
3
3
|
|
4
4
|
Embulk plugin for Salesforce.com Event Log Files input
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
To extract EventLogFiles:
|
7
|
+
1. check sample\_config.yml and edit OAuth ID, secret, username and password
|
8
|
+
2. run embulk
|
@@ -33,9 +33,6 @@ module Embulk
|
|
33
33
|
|
34
34
|
task['records'] = query(client, task)
|
35
35
|
|
36
|
-
if schema.empty?
|
37
|
-
raise 'empty schema given'
|
38
|
-
end
|
39
36
|
reports = yield(task, schema, threads)
|
40
37
|
last_log_date_report = reports.max_by { |report|
|
41
38
|
report['last_log_date']
|
@@ -98,7 +95,6 @@ module Embulk
|
|
98
95
|
client = self.class.init_client(HTTPClient.new, task)
|
99
96
|
records = task['records']
|
100
97
|
last_log_date = Time.parse(task['last_log_date'])
|
101
|
-
columns = schema.map { |c| c.name }
|
102
98
|
records.each do |record|
|
103
99
|
event_type = record['EventType']
|
104
100
|
last_log_date = [last_log_date, Time.parse(record['LogDate']).to_i].max
|
@@ -106,13 +102,13 @@ module Embulk
|
|
106
102
|
log_body = client.get_content(log_file)
|
107
103
|
CSV.parse(log_body, headers: true) do |row|
|
108
104
|
if row['TIMESTAMP']
|
109
|
-
|
110
|
-
row['TIMESTAMP'] = Time.parse(row['TIMESTAMP']).to_i
|
111
|
-
rescue
|
112
|
-
# ignore
|
113
|
-
end
|
105
|
+
row['time'] = Time.parse(row['TIMESTAMP']).to_i rescue nil
|
114
106
|
end
|
115
|
-
page_builder.add(
|
107
|
+
page_builder.add(schema.map { |c|
|
108
|
+
v = row[c.name]
|
109
|
+
v = v.to_i if c.type == 'long'
|
110
|
+
v
|
111
|
+
})
|
116
112
|
end
|
117
113
|
end
|
118
114
|
page_builder.finish unless records.empty?
|