2016-03-19 10 views
0

ich folgende bin die folgenden Schritte aus:Hive Elasticsearch zu Kibana: Keine Felder im Feld Verfügbar Spalte

Step 1: 
create table tutorials_tbl(submission_date date, tutorial_id INT,tutorial_title STRING,tutorial_author STRING) ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'; 

Step 2: 
INSERT INTO tutorials_tbl (submission_date, tutorial_title, tutorial_author) VALUES ('2016-03-19 18:00:00', "Mark Smith", "John Paul"); 

Step 3: 
CREATE EXTERNAL TABLE tutorials_tbl_es(submission_date date,tutorial_id INT,tutorial_title STRING,tutorial_author STRING)STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource'='tutor/tutors','es.nodes'='saturn:9200'); 

Step 4: 
INSERT INTO tutorials_tbl_es SELECT * FROM tutorials_tbl LIMIT 1; 

Now I selected the index in Kibana>Settings. I have configured _timestamp in the advanced settings so i only got that in the Time-field name even though I have submission_date column in the data. 

Frage 1: Warum bin ich nicht submission_date im Time-Feldnamen zu bekommen?

Frage 2: Wenn ich _timestamp ausgewählt und auf "Erstellen" geklickt habe, habe ich unter Verfügbare Felder im Register "Discover" nichts erhalten. Warum ist das so?

+0

Könnten Sie Elasticsearch Index Mapping-Datei – Arun

+0

Hier teilen, ist die Datei: Ich weiß nicht, wie man es formatiert. {"Tutor": {"Aliase": {}, "Zuordnungen": {"Tutoren": {"Eigenschaften": {"@ Timestamp": {"Typ": "Zeichenfolge"}, "created_on": {"type": "Zeichenkette"}, "tutorial_author": {"Typ": "Zeichenkette"}, "tutorial_id": {"Typ": "lang"}, "tutorial_title": {"Typ": "Zeichenkette" }}}}, "Einstellungen": {"index": {"creation_date": "1458356711152", "uuid": "7cAEGzhvQPit0R8atxgRbw", "Anzahl_der_Replikate": "1", "Anzahl_der_Shards": "5", "Version" : {"created": "2000099"}}}, "warmers": {}}} – Gagan

+0

Ich bin mir ziemlich sicher, dass mir etwas im Mapping fehlt, wie man Datenspalten in ES mit Kibana abbildet – Gagan

Antwort

1

Bitte laden Sie Daten in tutorials_tbl und versuchen Sie diese Schritte wie folgt.

Schritt 1: Erstellen Sie "Tutor" dynamische Vorlage mit Einstellungen und Zuordnungen.

{ 
    "order": 0, 
    "template": "tutor-*", 
    "settings": { 
    "index": { 
    "number_of_shards": "4", 
    "number_of_replicas": "1", 
    "refresh_interval": "30s" 
    } 
    }, 
"mappings": { 

"tutors": { 
"dynamic": "true", 
"_all": { 
"enabled": true 
}, 
"_timestamp": { 
"enabled": true, 
"format": "yyyy-MM-dd HH:mm:ss" 
}, 
"dynamic_templates": [ 
{ 
"disable_string_index": { 

"mapping": { 
"index": "not_analyzed", 
"type": "string" 
}, 
"match_mapping_type": "string", 
"match": "*" 
} 

} 
], 
"date_detection": false, 
"properties": { 
"submission_date": { 
"type": "date", 
"format": "yyyy-MM-dd HH:mm:ss" 
}, 
"tutorial_id": { 
"index": "not_analyzed", 
"type": "integer" 
}, 
"tutorial_title": { 
"index": "not_analyzed", 
"type": "string" 
}, 
"tutorial_author": { 
"index": "not_analyzed", 
"type": "string" 
} 
} 
} 
} 
} 

Schritt 2: ES index "Tutor" basierend auf tutor- * Vorlage (aus Schritt 1).

Ich verwende in der Regel Elasticsearch Kopf "Index" Registerkarte/"Jede Anfrage", um es zu erstellen.

Schritt 3: erstellen ES HIVE Tabelle mit Zeitstempel-Mapping

CREATE EXTERNAL TABLE tutorials_tbl_es(submission_date STRING ,tutorial_id INT,tutorial_title STRING,tutorial_author STRING) 
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler' TBLPROPERTIES('es.resource'='tutor/tutors','es.nodes'='saturn:9200','es.mapping.timestamp'='submission_date'); 

Schritt 4: Einsatzdaten von tutorials_tbl tutorials_tbl_es

INSERT INTO tutorials_tbl_es SELECT * FROM tutorials_tbl LIMIT 1; 
Verwandte Themen