This repository contains comprehensive Elasticsearch training materials designed for developers, including a practical .NET 9.0 log simulator application for hands-on learning.
Türkçe: Bu proje, şirket içi yazılım geliştiricilere yönelik kapsamlı bir Elasticsearch eğitimi için geliştirilmiş materyaller ve pratik bir .NET 9.0 log simülatörü uygulaması içerir. Daha fazla Türkçe kaynak için aşağıdaki belgelere göz atın.
- Complete Training Curriculum (Kapsamlı Eğitim Müfredatı)
- English: Lesson Plan - Instructor guide with timing and detailed curriculum.
- Türkçe: Ders Planı - Eğitmen kılavuzu, zamanlama ve detaylı müfredat.
- Student Textbook (Öğrenci Ders Kitabı)
- English: Textbook - Complete learning materials in modular format.
- Türkçe: Ders Kitabı - Modüler formatta eksiksiz öğrenim materyalleri.
- Practical Exercises (Pratik Uygulamalar) - HTTP request collections for hands-on practice. (HTTP Examples)
- .NET Log Simulator (.NET Log Simülatörü) - ASP.NET Core application that generates realistic log data for training scenarios.
- Docker Environment (Docker Ortamı) - Ready-to-use Elasticsearch and Kibana setup.
- Index Template Management - Automatic creation of
application_logs
template with proper mappings - Products Index Setup - Pre-configured product data index for training exercises
- Sample Data Loading - Automated loading of sample datasets for immediate practice
- Real-time Log Generation - Background service generating continuous log streams with realistic patterns
- Historical Data Generation - Creates 30 days of historical log data with business hour patterns
- Connection Monitoring - Real-time Elasticsearch cluster health and connection status
- Training-focused UI - Simple interface designed specifically for educational scenarios
- .NET 9.0 SDK or later
- Docker and Docker Compose
- 4GB+ RAM available for Elasticsearch
- Web browser for Kibana access
git clone https://github.com/DogusTeknoloji/ElasticsearchTraining.git
cd ElasticsearchTraining
# Navigate to docker directory
cd docker
# Start the stack
docker-compose up -d
# Verify services are running
docker-compose ps
Wait for services to be ready (usually 2-3 minutes). You can check:
- Elasticsearch: http://localhost:9200
- Kibana: http://localhost:5601
# Navigate to the application directory (Uygulama dizinine gidin)
cd src/ElasticTraining
# Restore dependencies (Bağımlılıkları yükleyin)
dotnet restore
# Run the application (Uygulamayı çalıştırın)
dotnet run
The application will be available at (Uygulama şu adreste mevcut olacaktır): https://localhost:5001
The training is organized into 6 sections:
- Introduction to Elasticsearch - Architecture, concepts, and basic operations
- Data Modeling and Mapping - Document structure, field types, and index design
- Search and Query DSL - Powerful search capabilities and query construction
- Aggregations and Analytics - Data analysis and statistical operations
- Log Management - Practical log analysis scenarios
- Production Considerations - Performance, monitoring, and best practices
- Lesson Plan (Ders Planı):
- English: Lesson Plan
- Türkçe: Ders Planı
- Student Textbook (Öğrenci Ders Kitabı):
- English: Textbook (links to
Section0X.md
files) - Türkçe: Ders Kitabı (links to
Section0X.tr.md
files)
- English: Textbook (links to
- HTTP Examples (HTTP Örnekleri): HTTP Requests (Contains
.http
files for practice)
- Review the lesson plans: English Lesson Plan or Turkish Lesson Plan.
- Start Elasticsearch and Kibana using Docker Compose.
- Run the log simulator application.
- Use provided HTTP request examples for demonstrations.
- Guide students through hands-on exercises.
- Start with the textbook materials: English Textbook or Turkish Textbook.
- Set up the environment using Docker Compose.
- Work through practical exercises using the log simulator.
- Practice with provided HTTP request collections.
- Explore real-time data analysis with generated logs.
The application generates realistic log data including:
- Service Logs - Application performance and error tracking
- HTTP Request Logs - API usage patterns and response times
- Exception Handling - Error analysis with stack traces
- Business Metrics - Service-level indicators and trends
Test your skills with these scenarios in Kibana Dev Tools:
# Monitor error rates by service
GET /application_logs-*/_search
{
"size": 0,
"aggs": {
"error_by_service": {
"terms": {"field": "service_name"},
"aggs": {
"error_rate": {
"filter": {"term": {"level": "ERROR"}}
}
}
}
}
}
# Find slow API responses
GET /application_logs-*/_search
{
"query": {
"range": {
"response_time_ms": {"gte": 1000}
}
},
"sort": [{"response_time_ms": {"order": "desc"}}]
}
Configure Elasticsearch connection in src/ElasticTraining/appsettings.json
:
{
"Elasticsearch": {
"Uri": "http://localhost:9200",
"Username": "",
"Password": ""
}
}
The included Docker Compose setup provides:
- Elasticsearch 8.13.4 - Single node cluster optimized for development
- Kibana 8.13.4 - Data visualization and dev tools interface
- Persistent Storage - Data persists between container restarts
- Memory Settings - 1GB heap size (adjust based on your system)
Index Pattern: application_logs-YYYY-MM-DD
{
"@timestamp": "2024-05-25T10:30:00.000Z",
"correlation_id": "abc123-def456",
"service_name": "user-service",
"level": "INFO",
"thread_name": "http-nio-8080-exec-1",
"logger_name": "com.company.UserController",
"host_ip": "192.168.1.10",
"message": "User login successful",
"http_status_code": 200,
"response_time_ms": 145
}
Index Name: products
{
"sku": "LAPTOP-DELL-001",
"name": "Dell Latitude 7420",
"description": "Business laptop with Intel i7",
"price": 1299.99,
"stock_quantity": 25,
"category": "Electronics",
"tags": ["laptop", "business", "intel"],
"created_date": "2024-05-25",
"is_active": true
}
# Run unit tests
dotnet test
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"
# Run in development mode with hot reload
dotnet watch run --project src/ElasticTraining
The application includes detailed logging and error handling for troubleshooting Elasticsearch connectivity and data generation issues.
We welcome contributions to improve the training materials! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow existing code style and conventions
- Add tests for new functionality
- Update documentation as needed
- Ensure all training materials remain accurate
See CHANGELOG.md for detailed version history.
Elasticsearch Connection Failed
- Verify Docker containers are running:
docker-compose ps
- Check Elasticsearch logs:
docker-compose logs elasticsearch
- Ensure port 9200 is not blocked by firewall
Out of Memory Errors
- Increase Docker memory allocation (4GB+ recommended)
- Adjust ES_JAVA_OPTS in docker-compose.yml
Slow Performance
- Monitor system resources during log generation
- Reduce log generation frequency in application settings
- Consider using SSD storage for Docker volumes
- 📖 Documentation: Check the docs directory
- 🐛 Issues: Report bugs via GitHub Issues
- 💬 Discussions: Join discussions in GitHub Discussions
This project is licensed under the MIT License - see the LICENSE file for details.
- Elastic Stack Team - For creating powerful search and analytics tools
- Microsoft .NET Team - For the excellent development platform
- Training Participants - For valuable feedback and contributions
Made with ❤️ for the developer community