Skip to content

Commit 0933aeb

Browse files
committed
Create matching Kibana index pattern by API
1 parent 23c1aab commit 0933aeb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

blog/mozin-about/collection.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# Collect Mozi sample data
44
curl -X POST https://threatfox-api.abuse.ch/api/v1/ -d '{ "query": "taginfo", "tag": "Mozi", "limit": 1000 }' > mozi-raw.json
55

6-
# Local Elasticsearch
6+
# Local Elasticsearch & Kibana
77
ES_HOST='http://elastic:password@localhost:9200'
8+
KBN_HOST='http://elastic:password@localhost:5601'
89

910
# Elastic Cloud
1011
# ES_HOST='https://elastic:changeme@abcdef0123456789abcdef0123456789.us-central1.gcp.cloud.es.io:9243'
12+
# KBN_HOST='https://elastic:changeme@0123456789abcdef01234567890abcdef.us-central1.gcp.cloud.es.io:9243'
1113

1214
# Create the Threat Fox Ingest Pipeline
1315
curl -XPUT ${ES_HOST}/_ingest/pipeline/threatfox-enrichment -H 'Content-Type: application/json' [email protected]
@@ -26,3 +28,15 @@ curl --silent -XPOST \
2628
--data-binary \
2729
@- \
2830
${ES_HOST}/indicators/_doc/_bulk
31+
32+
# Create Kibana index pattern
33+
curl -XPOST -H 'kbn-xsrf: true' -H 'Content-Type: application/json' \
34+
${KBN_HOST}/api/index_patterns/index_pattern -d'
35+
{
36+
"override": false,
37+
"refresh_fields": true,
38+
"index_pattern": {
39+
"title": "indicators*",
40+
"timeFieldName": "event.ingested"
41+
}
42+
}'

0 commit comments

Comments
 (0)