Skip to content

Commit b8d6199

Browse files
committed
upload files
0 parents  commit b8d6199

7 files changed

+91
-0
lines changed

.gitignore

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Ignore .directory created by file manager dolphine
2+
.directory
3+
# For csv.gz data
4+
*.csv.gz
5+
# For aria2 downloading tempearary files
6+
*.aria2
7+
# For url(s) which was captured by pandas from HTML pages
8+
*.url
9+
# For ruby tool "dap" packages
10+
# Ignore rvm files
11+
.ruby-version
12+
.ruby-gemset
13+
14+
# Ignore geoip data file
15+
data/geoip.dat
16+
17+
data/
18+
env_python27_nervey/
19+
*.swp
20+
*.swo
21+
*.swq
22+
# Byte-compiled / optimized / DLL files
23+
__pycache__/
24+
*.py[cod]
25+
*~
26+
.idea/
27+
.idea/*
28+
# C extensions
29+
*.so
30+
# Distribution / packaging
31+
.Python
32+
env/
33+
bin/
34+
build/
35+
develop-eggs/
36+
dist/
37+
eggs/
38+
lib/
39+
lib64/
40+
parts/
41+
sdist/
42+
var/
43+
*.egg-info/
44+
.installed.cfg
45+
*.egg
46+
# Installer logs
47+
pip-log.txt
48+
pip-delete-this-directory.txt
49+
# Unit test / coverage reports
50+
htmlcov/
51+
.tox/
52+
.coverage
53+
.cache
54+
nosetests.xml
55+
coverage.xml
56+
# Translations
57+
*.mo
58+
# Mr Developer
59+
.mr.developer.cfg
60+
.project
61+
.pydevproject
62+
# Rope
63+
.ropeproject
64+
# Django stuff:
65+
*.log
66+
*.pot
67+
# Sphinx documentation
68+
docs/_build/

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
json-py-es
2+
==========
3+
* To import raw JSON data files to ElasticSearch using Python
4+
5+
> Using ElasticSearch Bulk API to import this data, sometimes ES only recognizes data in its request style. Now let `json-py-es` glue them all.
6+

export_data.sh

Whitespace-only changes.

json-py-es.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import elasticsearch
2+
es = elasticsearch.Elasticsearch

new_data.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"index":{"_index":"serverdata", "_type":"smtp"}}
2+
{"ip":"23.91.113.228","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 poppy.arvixe.com ESMTP\r\n","ehlo":"250-poppy.arvixe.com\r\n250-SIZE 20480000\r\n250 AUTH LOGIN\r\n","starttls":"502 STARTTLS NOT ALLOWED.\r\n"},"error":"Bad return code for STARTTLS","error_component":"starttls"}
3+
{"index":{"_index":"serverdata", "_type":"smtp"}}
4+
{"ip":"204.3.67.57","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 center-transforming-relationships.com ESMTP \r\n","ehlo":"250-center-transforming-relationships.com \r\n250-PIPELINING\r\n250-SIZE 36700160\r\n250 8BITMIME\r\n","starttls":"502 unimplemented (#5.5.1)\r\n"},"error":"Bad return code for STARTTLS","error_component":"starttls"}

raw_data.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{"ip":"74.63.161.124","timestamp":"2015-10-16T14:00:13-04:00","data":{},"error":"EOF","error_component":"banner"}
2+
{"ip":"65.36.165.102","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 MORS.ad.safesecureweb.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at Fri, 16 Oct 2015 13:57:02 -0400 \r\n","ehlo":"250-MORS.ad.safesecureweb.com Hello [141.212.122.128]\r\n250-TURN\r\n250-SIZE 2097152\r\n250-ETRN\r\n250-PIPELINING\r\n250-DSN\r\n250-ENHANCEDSTATUSCODES\r\n250-8bitmime\r\n250-BINARYMIME\r\n250-CHUNKING\r\n250-VRFY\r\n250 OK\r\n","starttls":"554 5.7.3 Unable to initialize security subsystem\r\n"},"error":"Bad return code for STARTTLS","error_component":"starttls"}
3+
{"ip":"23.91.113.228","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 poppy.arvixe.com ESMTP\r\n","ehlo":"250-poppy.arvixe.com\r\n250-SIZE 20480000\r\n250 AUTH LOGIN\r\n","starttls":"502 STARTTLS NOT ALLOWED.\r\n"},"error":"Bad return code for STARTTLS","error_component":"starttls"}
4+
{"ip":"204.3.67.57","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 center-transforming-relationships.com ESMTP \r\n","ehlo":"250-center-transforming-relationships.com \r\n250-PIPELINING\r\n250-SIZE 36700160\r\n250 8BITMIME\r\n","starttls":"502 unimplemented (#5.5.1)\r\n"},"error":"Bad return code for STARTTLS","error_component":"starttls"}
5+
{"ip":"45.43.231.247","timestamp":"2015-10-16T14:00:13-04:00","data":{},"error":"read tcp 45.43.231.247:25: connection reset by peer","error_component":"banner"}
6+
{"ip":"204.73.44.226","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 Augusoft Internal Email Server At Your Service\r\n","ehlo":"250-mrsshepherd.com [141.212.122.128], this server offers 4 extensions\r\n250-AUTH LOGIN\r\n250-SIZE 20480000\r\n250-HELP\r\n250 AUTH=LOGIN\r\n","starttls":"503 Bad sequence of commands\r\n"},"error":"Bad return code for STARTTLS","error_component":"starttls"}
7+
{"ip":"200.46.210.154","timestamp":"2015-10-16T14:00:13-04:00","data":{},"error":"read tcp 200.46.210.154:25: connection reset by peer","error_component":"banner"}
8+
{"ip":"50.28.80.160","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220-raptor.ws9000.net ESMTP Exim 4.85 #2 Fri, 16 Oct 2015 14:00:13 -0400 \r\n220-We do not authorize the use of this system to transport unsolicited, \r\n220 and/or bulk e-mail.\r\n","ehlo":"250-raptor.ws9000.net Hello researchscan383.eecs.umich.edu [141.212.122.128]\r\n250-SIZE 52428800\r\n250-8BITMIME\r\n250-PIPELINING\r\n250-AUTH PLAIN LOGIN\r\n250-STARTTLS\r\n250 HELP\r\n","starttls":"220 TLS go ahead\r\n","tls":{"client_hello":{"random":"tF27lvgudpkDoEsorUp0saOIgVPfjc7ZbJFCmAZxbHQ="}}},"error":"remote error: handshake failure","error_component":"starttls"}
9+
{"ip":"50.93.209.78","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220-charybdis.restechservices.net ESMTP Exim 4.85 #2 Fri, 16 Oct 2015 13:00:12 -0500 \r\n220-We do not authorize the use of this system to transport unsolicited, \r\n220 and/or bulk e-mail.\r\n","ehlo":"250-charybdis.restechservices.net Hello researchscan383.eecs.umich.edu [141.212.122.128]\r\n250-SIZE 52428800\r\n250-8BITMIME\r\n250-PIPELINING\r\n250-AUTH PLAIN LOGIN\r\n250-STARTTLS\r\n250 HELP\r\n","starttls":"220 TLS go ahead\r\n","tls":{"client_hello":{"random":"FT0jMqzr1KkF/eurB1K2xdgfNLw0K8+9P6HwMtrSaWw="}}},"error":"remote error: handshake failure","error_component":"starttls"}
10+
{"ip":"66.96.180.160","timestamp":"2015-10-16T14:00:13-04:00","data":{"banner":"220 ESMTP Fri, 16 Oct 2015 14:00:13 -0400: UCE strictly prohibited\r\n","ehlo":"250-bosauthsmtp10.yourhostingaccount.com Hello eecs.umich.edu [141.212.122.128]\r\n250-SIZE 34603008\r\n250-8BITMIME\r\n250-PIPELINING\r\n250-AUTH PLAIN LOGIN\r\n250-STARTTLS\r\n250 HELP\r\n","starttls":"220 TLS go ahead\r\n","tls":{"client_hello":{"random":"SoAhgklxKMZefAJywXW8FjEg+815O8NpsTwx2sQxvtQ="}}},"error":"remote error: handshake failure","error_component":"starttls"}

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
elasticsearch

0 commit comments

Comments
 (0)