This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "/path/to/your/log/file" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
grok { | |
match => {"message" => "%{COMBINEDAPACHELOG}"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Content-Type: application/json" "127.0.0.1:9200/mangas/_doc/1?pretty" -d ' | |
{ | |
"id": 1, | |
"title": "One piece", | |
"author": "Eiichiro Oda", | |
"url": "https://myanimelist.net/manga/13/One_Piece" | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST -H "Content-Type: application/json" "127.0.0.1:9200/mangas/_doc/1/_update?pretty" -d ' | |
{ | |
"doc": { | |
"url": "https://myanimelist.net/manga/14/One_Piece" | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPOST -H "Content-Type: application/json" "127.0.0.1:9200/_bulk?pretty" -d ' | |
{ "create" : { "_index" : "mangas", "_id" : "1" } } | |
{ "id": "1", "title" : "One Piece", "year":1997 , "genre":["Action", "Adventure", "Comedy"] } | |
{ "create" : { "_index" : "mangas", "_id" : "2" } } | |
{ "id": "2", "title" : "Slam Dunk", "year":1990 , "genre":["Comedy", "Drama", "School"] } | |
{ "create" : { "_index" : "mangas", "_id" : "3" } } | |
{ "id": "3", "title" : "20th Century Boys", "year":1999 , "genre":["Mystery", "Drama", "Historical"] } | |
{ "create" : { "_index" : "mangas", "_id" : "4" } } | |
{ "id": "4", "title" : "Kaguya-sama: Love is War", "year":2015 , "genre":["Comedy", "Romance", "School"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -H "Content-Type: application/json" -XGET "127.0.0.1:9200/mangas/_search?pretty" -d ' | |
{ | |
"sort" : [ | |
{ | |
"year" : "desc" | |
} | |
] | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT -H "Content-Type: application/json" "127.0.0.1:9200/mangas_reindexed?pretty" -d ' | |
{ | |
"mappings": { | |
"properties": { | |
"title": { | |
"type": "text", | |
"fields": { | |
"raw": { | |
"type": "keyword" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/mangas/_search?pretty" -d ' | |
{ | |
"query": { | |
"match": { | |
"title": "Journey" | |
} | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/mangas/_search?pretty" -d ' | |
{ | |
"query": { | |
"term": { | |
"year": 1990 | |
} | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/mangas/_search?pretty" -d ' | |
{ | |
"query": { | |
"term": { | |
"title": "One Piece" | |
} | |
} | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET -H "Content-Type: application/json" "127.0.0.1:9200/mangas_reindexed/_search?pretty" -d ' | |
{ | |
"query": { | |
"term": { | |
"title.raw": "One Piece" | |
} | |
} | |
}' |
OlderNewer