Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) PUT goodboy
- DELETE /goodboy/
- 2) PUT /goodboy/
- {
- "mappings": {
- "logs": {
- "properties": {
- "@timestamp": {
- "type": "date"
- },
- "@version": {
- "type": "text",
- "fields": {
- "keyword": {
- "type": "keyword",
- "ignore_above": 256
- }
- }
- },
- "city": {
- "type": "text",
- "fields": {
- "keyword": {
- "type": "keyword",
- "ignore_above": 256
- }
- }
- },
- "cost": {
- "type": "long"
- },
- "floor": {
- "type": "long"
- },
- "location": {
- "type": "geo_point"
- },
- "latitude": {
- "type": "float"
- },
- "longitude": {
- "type": "float"
- },
- "name": {
- "type": "text",
- "fields": {
- "keyword": {
- "type": "keyword",
- "ignore_above": 256
- }
- }
- },
- "rend": {
- "type": "text",
- "fields": {
- "keyword": {
- "type": "keyword",
- "ignore_above": 256
- }
- }
- },
- "room": {
- "type": "long"
- },
- "square": {
- "type": "text",
- "fields": {
- "keyword": {
- "type": "keyword",
- "ignore_above": 256
- }
- }
- }
- }
- }
- }
- }
- 3)
- //////////////////в goodboy.conf////////////
- input {
- jdbc {
- jdbc_driver_library => "/home/a/Downloads/mysql-connector-java-5.0.8-bin.jar"
- jdbc_driver_class => "com.mysql.jdbc.Driver"
- jdbc_connection_string => "jdbc:mysql://localhost:3306/DB_testadmin2"
- jdbc_validate_connection => true
- jdbc_user => "root"
- jdbc_password => ""
- # our query
- statement => "select name, rend, cost, city, floor, room, square, latitude, longitude from houses inner join cities on cities.id = houses.id_city inner join rends on houses.id_rend = rends.id inner join costs on houses.id_cost = costs.id inner join squares on houses.id_square = squares.id inner join rooms on houses.id_room = rooms.id inner join floors on houses.id_floor = floors.id LIMIT 75,20"
- jdbc_paging_enabled => "true"
- jdbc_page_size => "50000"
- }
- }
- filter {
- if [latitude] and [longitude] {
- mutate {
- add_field => [ "[location][lon]", "%{longitude}" ]
- add_field => [ "[location][lat]", "%{latitude}" ]
- }
- mutate {
- convert => [ "[location][lat]", "float" ]
- convert => [ "[location][lon]", "float" ]
- }
- }
- }
- output {
- stdout { codec => rubydebug }
- elasticsearch {
- index => "goodboy"
- }
- }
- ////////////////////////////////////////////
- //////////////////////check
- 4) GET goodboy/_mapping
- "mappings": {
- "log": {
- "properties": {
- "location": {
- "type": "geo_point"
- }
- }
- }
Add Comment
Please, Sign In to add comment