Zack Saadioui
8/27/2024
1
2
bash
curl -fsSL https://ollama.com/install.sh | sh1
2
bash
docker run -d --name elasticsearch -p 9200:9200 -e "discovery.type=single-node" elasticsearch:latest1
http://localhost:92001
curl1
2
bash
curl -X GET "localhost:9200/"1
2
bash
ollama run llama31
2
bash
ollama query "What's the purpose of logs?"1
2
3
4
5
6
7
bash
curl -X POST "localhost:9200/logs/_doc" -H 'Content-Type: application/json' -d '
{
   "timestamp": "2024-01-01T00:00:00",
   "level": "error",
   "message": "Error occurred in application."
}'1
logs-*1
2
bash
ollama query "Summarize the errors in the logs."1
2
3
4
5
python
user_query = input("What would you like to search in logs?")
es_query = ollama.query(generate_query(user_query))
results = send_to_elasticsearch(es_query)
print(results)Copyright © Arsturn 2025