Most Asked ELK Stack Interview Questions for Freshers (2027)

66 hands-on ELK Stack interview questions for freshers: _cat APIs, match/term/bool queries, aggregations, Logstash grok, Filebeat modules and Kibana KQL.

Sep 17, 2025 - 09:57
Nov 8, 2026 - 23:20
 0  179
Most Asked ELK Stack Interview Questions for Freshers (2027)

The most asked ELK Stack questions for freshers are practical: check cluster health with the _cat APIs, create an index and add a document, write a match, term, range and bool query, test a Logstash pipeline, read a grok pattern, enable a Filebeat module, and search logs in Kibana with KQL. Interviewers want to see you type, not recite definitions.

This page has 66 hands-on questions with the command or query an interviewer expects, grouped by level with a scenario section at the end. It assumes a recent Elastic Stack 8.x or 9.x install, where security is on by default. If you need the definitions first (what a shard is, what an inverted index is), start with our 80+ ELK Stack interview questions guide and come back here to practise.

Key takeaways

  • Fresher rounds increasingly include a live task: "show me the cluster health", "write a query for errors in the last hour", "fix this grok pattern".
  • Default ports: Elasticsearch HTTP 9200 and transport 9300, Kibana 5601, Logstash monitoring API 9600, and 5044 is the usual Beats input port on Logstash.
  • Since 8.0, Elasticsearch starts with TLS and authentication on. Your curl commands need https, a CA certificate and credentials.
  • Learn five queries well: match, term, range, bool and a terms aggregation. They cover most live tasks.
  • Always test Logstash configuration with --config.test_and_exit before starting it.
  • Kibana questions focus on Discover, KQL, data views and building one Lens chart.

Where this page fits

PageAngle
This pageHands-on commands and queries for freshers
80+ ELK Stack interview questionsConcepts and architecture, freshers to senior
50+ real-time ELK Stack questionsStreaming ingest, refresh, alerting latency

Set up a practice environment first

You will learn faster with a single-node lab. Elastic's own local install script or Docker images work. On first start, Elasticsearch 8 and later print the elastic user's password and a Kibana enrollment token. If you missed them, reset or create them with the bundled tools:

bin/elasticsearch-reset-password -u elastic
bin/elasticsearch-create-enrollment-token -s kibana

Set a shell variable so the examples below stay short. The CA file is created under the Elasticsearch config directory on first start (config/certs/http_ca.crt for archive installs).

export ES="https://localhost:9200"
export CURL="curl -s --cacert config/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD"

Kibana's Dev Tools console is the easiest place to run the JSON examples. The questions show both forms where it helps.

ELK Stack interview questions for freshers: Elasticsearch tasks

1. How do you check that Elasticsearch is running?

Call the root endpoint. It returns the node name, cluster name and version.

$CURL $ES/

2. How do you check cluster health?

Use _cluster/health or the compact _cat/health. Green means all shards are assigned, yellow means some replicas are not, red means at least one primary is missing.

$CURL "$ES/_cat/health?v"
$CURL "$ES/_cluster/health?pretty"

3. Why is a single-node cluster yellow?

Indices default to one replica, and a replica cannot sit on the same node as its primary. With one node the replica stays unassigned. Set number_of_replicas to 0 on a lab node, or add a node.

4. How do you list indices with their size and document count?

$CURL "$ES/_cat/indices?v&s=store.size:desc"

The v parameter adds headers and s sorts. Interviewers like candidates who know the _cat APIs are for humans and the JSON APIs are for scripts.

5. How do you list nodes and see their roles?

$CURL "$ES/_cat/nodes?v&h=name,node.role,heap.percent,cpu,load_1m"

The h parameter picks columns. Role letters show which roles each node has, for example m for master-eligible and d for data.

6. How do you find unassigned shards and the reason?

$CURL "$ES/_cat/shards?v&h=index,shard,prirep,state,unassigned.reason"
$CURL "$ES/_cluster/allocation/explain?pretty"

The allocation explain API tells you why a shard cannot be placed, for example disk watermarks or no eligible node.

7. How do you create an index with settings and a mapping?

PUT app-logs
{
  "settings": { "number_of_shards": 1, "number_of_replicas": 0 },
  "mappings": {
    "properties": {
      "@timestamp": { "type": "date" },
      "level":      { "type": "keyword" },
      "service":    { "type": "keyword" },
      "message":    { "type": "text" },
      "latency_ms": { "type": "long" }
    }
  }
}

Use keyword for values you filter or aggregate on exactly, and text for free text you search by words.

8. How do you add a document and read it back?

POST app-logs/_doc/1
{ "@timestamp": "2026-11-07T10:00:00Z", "level": "ERROR",
  "service": "payments", "message": "Timeout calling bank API", "latency_ms": 5021 }

GET app-logs/_doc/1

Use POST index/_doc without an ID to let Elasticsearch generate one.

9. How do you count documents in an index?

GET app-logs/_count

10. How do you view an index mapping?

GET app-logs/_mapping

Check this whenever a query returns nothing; often the field is text when you expected keyword, or the reverse.

11. Write a match query for messages containing "timeout".

GET app-logs/_search
{ "query": { "match": { "message": "timeout" } } }

match runs the search text through the field's analyzer, so case and word forms are handled by the analyzer.

12. Write a term query for level ERROR. Why does it fail on a text field?

GET app-logs/_search
{ "query": { "term": { "level": "ERROR" } } }

term looks for the exact token. On a text field the stored tokens are lowercased by the standard analyzer, so ERROR does not match. Use a keyword field (often level.keyword with dynamic mapping) for exact matches.

13. Write a range query for latency above 1000 ms in the last hour.

GET app-logs/_search
{
  "query": {
    "bool": {
      "filter": [
        { "range": { "latency_ms": { "gt": 1000 } } },
        { "range": { "@timestamp": { "gte": "now-1h" } } }
      ]
    }
  }
}

14. Write a bool query: errors from the payments service, excluding health checks.

GET app-logs/_search
{
  "query": {
    "bool": {
      "filter":   [ { "term": { "level": "ERROR" } }, { "term": { "service": "payments" } } ],
      "must_not": [ { "match_phrase": { "message": "health check" } } ]
    }
  }
}

Put exact conditions in filter (no scoring, cacheable) and relevance search in must.

15. How do you return only some fields and sort by time?

GET app-logs/_search
{
  "_source": ["@timestamp", "service", "message"],
  "sort": [ { "@timestamp": "desc" } ],
  "size": 20,
  "query": { "match_all": {} }
}

16. Write a terms aggregation for errors per service.

GET app-logs/_search
{
  "size": 0,
  "query": { "term": { "level": "ERROR" } },
  "aggs": { "by_service": { "terms": { "field": "service", "size": 10 } } }
}

size: 0 skips the hits so only the aggregation returns. Aggregations need keyword or numeric fields.

17. Add an average latency per service.

GET app-logs/_search
{
  "size": 0,
  "aggs": {
    "by_service": {
      "terms": { "field": "service" },
      "aggs": { "avg_latency": { "avg": { "field": "latency_ms" } } }
    }
  }
}

18. How do you see how an analyzer splits text?

POST _analyze
{ "analyzer": "standard", "text": "Timeout calling Bank-API at 10:00" }

This explains most "why doesn't my search match?" questions.

19. How do you update one field of a document?

POST app-logs/_update/1
{ "doc": { "level": "WARN" } }

Elasticsearch writes a new version of the document internally; documents are not edited in place. In data streams, which are append-only, you use update by query or reindex instead.

20. How do you delete documents matching a query?

POST app-logs/_delete_by_query
{ "query": { "term": { "service": "test-service" } } }

For log data, deleting whole indices through lifecycle policies is far cheaper than deleting documents.

21. How do you load many documents at once?

With the Bulk API, which takes newline-delimited JSON: an action line followed by a source line, ending with a newline.

$CURL -H "Content-Type: application/x-ndjson" -X POST "$ES/_bulk" --data-binary @bulk.ndjson

22. Write a simple ES|QL query for errors per service.

FROM app-logs
| WHERE level == "ERROR"
| STATS errors = COUNT(*) BY service
| SORT errors DESC

ES|QL is generally available from 8.14 and is used in Discover and the _query API. Knowing it is a plus for recent roles.

23. How do you create an alias and switch it to a new index?

POST _aliases
{
  "actions": [
    { "remove": { "index": "app-logs-v1", "alias": "app-logs-current" } },
    { "add":    { "index": "app-logs-v2", "alias": "app-logs-current" } }
  ]
}

Both actions run atomically, so clients using the alias never see a gap. Aliases are how you reindex without changing application config.

24. How do you check disk usage per node?

$CURL "$ES/_cat/allocation?v"

It shows shards, disk used and disk percent per node. Watch the percentage against the disk watermarks (85% low, 90% high and 95% flood stage by default).

25. How do you see cluster settings, including defaults?

$CURL "$ES/_cluster/settings?include_defaults=true&pretty"

Persistent settings survive restarts; transient settings are discouraged in recent versions. Interviewers ask this to see if you know where a changed setting would show up.

26. How do you register a snapshot repository and take a snapshot?

PUT _snapshot/backup_repo
{ "type": "fs", "settings": { "location": "/mnt/es-backups" } }

PUT _snapshot/backup_repo/snap-2026-11-07?wait_for_completion=true
{ "indices": "app-logs*" }

A shared filesystem repository needs path.repo set in elasticsearch.yml on every node. In cloud setups you use an S3, GCS or Azure repository instead. Snapshot lifecycle management (SLM) schedules snapshots automatically.

27. How do you see long-running operations such as a reindex?

$CURL "$ES/_tasks?actions=*reindex&detailed&pretty"

Run _reindex with wait_for_completion=false to get a task ID back, then poll the task. This avoids timeouts on big copies.

28. How do you find which queries are slow?

Turn on the search slow log for an index with thresholds such as index.search.slowlog.threshold.query.warn: 5s, then read the slow log file. For one query, add "profile": true to the search body to see where time is spent.

Freshers: Logstash tasks

29. Write a minimal Logstash pipeline that reads stdin and prints structured output.

input  { stdin { } }
filter { }
output { stdout { codec => rubydebug } }

This is the fastest way to test filters: paste a log line and see the resulting event.

30. How do you check a Logstash config for syntax errors?

bin/logstash -f pipeline.conf --config.test_and_exit

Add --config.reload.automatic (or -r) when developing so changes reload without a restart.

31. Write a grok filter for an Nginx or Apache combined access log.

filter {
  grok  { match => { "message" => "%{COMBINEDAPACHELOG}" } }
  date  { match => [ "timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ] }
}

Field names depend on the ECS compatibility mode. In ECS mode, the pattern writes fields such as source.address and http.response.status_code, and the timestamp field name differs too, so check the output in rubydebug before writing the date filter.

32. A grok filter adds the tag _grokparsefailure. What do you do?

Copy a failing line, test the pattern piece by piece (Kibana's Grok Debugger in Dev Tools helps), and check for differences such as extra spaces, a missing field or a different timestamp format. Consider dissect for logs with a fixed delimiter layout; it is simpler and faster than regex.

33. Write a dissect filter for "2026-11-07T10:00:00Z ERROR payments Timeout calling bank".

filter {
  dissect { mapping => { "message" => "%{ts} %{level} %{service} %{msg}" } }
}

34. How do you send events from Logstash to Elasticsearch with security on?

output {
  elasticsearch {
    hosts    => ["https://localhost:9200"]
    ssl_certificate_authorities => ["/etc/logstash/certs/http_ca.crt"]
    api_key  => "${ES_API_KEY}"
    data_stream => "true"
  }
}

Use an API key or a dedicated user with only the privileges Logstash needs, and keep the secret in the Logstash keystore or environment, not in the file. Option names have changed across plugin versions, so check the docs for your version.

35. How do you receive logs from Filebeat in Logstash?

input { beats { port => 5044 } }

36. How do you see if Logstash is processing events?

Query the monitoring API on port 9600:

curl -s "localhost:9600/_node/stats/pipelines?pretty"

Compare events in and out per plugin to find the slow filter.

37. How do you rename, remove or convert fields in Logstash?

filter {
  mutate {
    rename       => { "lvl" => "level" }
    remove_field => [ "password", "headers" ]
    convert      => { "latency_ms" => "integer" }
  }
}

Removing sensitive fields before indexing is a common interview point, since logs often leak tokens and passwords.

38. How do you route events differently based on a field?

output {
  if [level] == "ERROR" {
    elasticsearch { hosts => ["https://localhost:9200"] index => "errors-%{+YYYY.MM.dd}" }
  } else {
    elasticsearch { hosts => ["https://localhost:9200"] index => "app-%{+YYYY.MM.dd}" }
  }
}

Conditionals work in filter and output blocks. In production you would add the security options from question 34, and many teams prefer data streams over daily index names.

39. How do you keep a Java stack trace as one event?

Join the lines at the shipper. In Filebeat's filestream input, use a multiline parser that treats lines not starting with a timestamp as continuations. Doing it in Filebeat is preferred over Logstash because it keeps line order per file.

parsers:
  - multiline:
      type: pattern
      pattern: '^\d{4}-\d{2}-\d{2}'
      negate: true
      match: after

40. How do you add location data from an IP address?

Use the geoip filter in Logstash or the geoip processor in an ingest pipeline on the client IP field. The result is a geo_point you can show on a Kibana map. Make sure the target field is mapped as geo_point in your template.

41. How do you run two separate pipelines in one Logstash instance?

# pipelines.yml
- pipeline.id: web
  path.config: "/etc/logstash/conf.d/web.conf"
- pipeline.id: audit
  path.config: "/etc/logstash/conf.d/audit.conf"
  pipeline.workers: 1

Separate pipelines stop a slow output in one from blocking the other, and each can have its own workers and queue settings.

Freshers: Beats and Kibana tasks

42. How do you check a Filebeat configuration and its connection to the output?

filebeat test config
filebeat test output

43. How do you collect Nginx logs with a ready-made module?

filebeat modules enable nginx
filebeat setup
systemctl start filebeat

filebeat setup loads index templates, ingest pipelines and sample dashboards, so it needs access to Elasticsearch and Kibana. Elastic Agent integrations managed by Fleet do the same job for newer deployments.

44. What is a data view, and how do you create one?

A data view tells Kibana which indices or data streams to query and which field is the timestamp. Create it in Stack Management, for example with the pattern logs-*. Data views were called index patterns before Kibana 8.0.

45. Write a KQL query for 5xx responses from the checkout service.

service.name : "checkout" and http.response.status_code >= 500

46. Write a KQL query for messages containing "timeout" but not from staging.

message : timeout and not labels.env : "staging"

47. How do you build a chart of errors over time?

Open Lens, pick the data view, drag @timestamp to the horizontal axis, use Count as the metric, and add a filter log.level : "error". Break down by service.name to see which service causes the spike. Save it to a dashboard.

48. How do you save a search and share it?

In Discover, set the query, filters, columns and time range, then save it as a Discover session (older versions call it a saved search). It can be added to dashboards or shared with a link. Pinned filters stay applied when you move between apps.

49. How do you create an alert when errors exceed a threshold?

In Kibana, create a rule such as the Elasticsearch query rule or a log threshold rule: choose the data view, set the condition (for example more than 50 documents with log.level : "error" in 5 minutes), the check interval, and an action such as email, Slack or a webhook through a connector. Some connectors need a paid subscription.

50. What are Kibana spaces?

Spaces divide saved objects such as dashboards and data views into separate areas, for example one per team. Combined with roles, they control who sees which dashboards.

Questions for 2 to 5 years of experience

51. How do you create an index template so new log indices get the right mapping?

PUT _index_template/app-logs-template
{
  "index_patterns": ["app-logs-*"],
  "data_stream": {},
  "template": {
    "settings": { "number_of_replicas": 1 },
    "mappings": { "properties": { "service": { "type": "keyword" } } }
  },
  "priority": 200
}

With data_stream set, writes to app-logs-anything create a data stream with backing indices.

52. How do you test an ingest pipeline before using it?

POST _ingest/pipeline/_simulate
{
  "pipeline": { "processors": [ { "lowercase": { "field": "level" } } ] },
  "docs": [ { "_source": { "level": "ERROR" } } ]
}

53. How do you change the number of replicas on an existing index?

PUT app-logs/_settings
{ "index": { "number_of_replicas": 1 } }

Replicas can change at any time. The number of primary shards cannot change in place; you use split, shrink or reindex.

54. How do you copy data into an index with a corrected mapping?

Create the new index with the right mapping, then run _reindex from old to new, check counts, and switch an alias to the new index so clients do not change.

55. How do you create an API key for a log shipper with minimal rights?

POST _security/api_key
{
  "name": "filebeat-web01",
  "role_descriptors": {
    "writer": {
      "cluster": ["monitor"],
      "indices": [ { "names": ["logs-*"], "privileges": ["auto_configure", "create_doc"] } ]
    }
  }
}

Senior-level questions

56. A cluster has thousands of tiny shards. What do you recommend?

Too many small shards waste heap and slow cluster state updates. Move to data streams with ILM rollover by size, so shards grow to a sensible size before rolling (Elastic's sizing guidance gives target ranges), merge or delete old small indices, and review templates that create daily indices for low-volume sources.

57. How would you plan log retention for 30 days hot and one year archive?

Define an ILM policy with rollover in the hot phase, a delete or cold phase after 30 days, and snapshots to object storage for the one-year archive (or searchable snapshots if the licence allows). Test restores, because a backup you have not restored is not proven.

58. How do you configure node roles for a hot-warm cluster?

# elasticsearch.yml on a hot node
node.roles: [ data_hot, data_content, ingest ]

# elasticsearch.yml on a warm node
node.roles: [ data_warm ]

# dedicated master-eligible node
node.roles: [ master ]

ILM then moves indices from hot to warm tiers automatically as they age. Use three dedicated master-eligible nodes in production so the cluster can still elect a master if one fails.

59. How do you upgrade a cluster with minimal downtime?

Read the upgrade notes and run the Upgrade Assistant in Kibana to find deprecated settings first. Take a snapshot. For minor and supported major upgrades, do a rolling upgrade: disable shard allocation for replicas, stop one node, upgrade it, restart, re-enable allocation and wait for green before the next node. Upgrade Elasticsearch before Kibana, and keep Beats and Logstash within supported version ranges.

60. How do you control who can see which logs?

Create roles with index privileges limited to certain data streams, add document-level security to filter by a field such as team, and field-level security to hide sensitive fields. Map roles to users from your identity provider through SAML or OIDC so access follows the company directory.

Scenario-based questions

61. Kibana Discover shows no logs from one server since this morning.

Check the shipper on that server (systemctl status filebeat, its log, filebeat test output), then disk space and credentials. In Elasticsearch, check the target data stream exists and the cluster is not blocking writes because of disk watermarks. Finally, confirm the Discover time range and data view; logs with a wrong timestamp may be indexed but appear in the wrong time window.

62. Indexing fails with errors saying the index is read-only.

The flood-stage disk watermark (95% by default) puts an index block on indices with shards on the full node. Free disk space or add capacity. Recent versions remove the block automatically once usage drops below the high watermark; older versions needed the index.blocks.read_only_allow_delete setting cleared by hand.

63. A field shows as "unknown" or conflict in a Kibana data view.

Different indices map the same field with different types, for example status as keyword in one and long in another. Fix the template so new indices agree, reindex if old data matters, then refresh the data view's field list.

64. Logstash is running, but nothing reaches Elasticsearch.

Read the Logstash log for 401 (wrong credentials or expired API key), 403 (missing privileges on the target), certificate errors (wrong CA path) or connection refused (wrong host or port). Check the monitoring API to see whether events enter the pipeline at all. If the input shows zero events, the problem is upstream at the shipper.

65. Indexing fails with "Limit of total fields [1000] has been exceeded".

Dynamic mapping created a new field for every unique key, often from JSON logs with IDs as keys. Raising index.mapping.total_fields.limit only delays the problem. Fix the source format, map the noisy object as flattened or disable dynamic mapping for it, and control fields through an index template.

66. A dashboard that used to load in two seconds now takes thirty.

Check the time range (someone may have set 90 days), the number of panels, and heavy aggregations such as high-cardinality terms. Use the search profiler or slow log to find the expensive query, and look at cluster load at the same time. Fixes include shorter default ranges, fewer panels and pre-aggregated data built with transforms or downsampling.

Mistakes interviewers notice in live ELK tasks

  • Using http://localhost:9200 on an 8.x or 9.x node and getting confused by the error. Security is on by default, so use HTTPS with the CA certificate and credentials.
  • Running a term query on a text field and assuming the data is missing.
  • Putting exact filters in must instead of filter, which scores results for no reason.
  • Writing a grok pattern without testing it on real lines, then guessing at field names.
  • Indexing passwords or tokens because nobody removed them in the pipeline.
  • Deleting documents one by one to free space instead of using lifecycle policies to drop whole indices.
  • Forgetting the time picker in Kibana and reporting "no data" when the range is wrong.

How to practise these in a week

DayPractice
1Install a single-node stack, run questions 1 to 10
2Queries and aggregations, questions 11 to 28
3Logstash with stdin and grok, questions 29 to 41
4Filebeat module and Kibana dashboard, questions 42 to 50
5Templates, ingest pipelines and API keys, questions 51 to 55
6Break things on purpose: fill a disk in a VM, break a grok pattern, change a mapping
7Explain every scenario aloud in under two minutes

For guided labs, our ELK Stack training in Pune runs in the Kharadi classroom and live online. To see where ELK sits among monitoring tools, read our top observability tools for DevOps and the explainer on ELK in centralized logging.

FAQ

What ELK Stack questions are asked of freshers?

Mostly practical tasks: check cluster health, create an index, write match, term, range and bool queries, run an aggregation, test a Logstash pipeline with grok, and search logs in Kibana with KQL.

Why does my term query return nothing?

The field is probably text, which stores lowercased tokens. Use the keyword version of the field for exact matches, or use a match query for text.

Why is my single-node Elasticsearch cluster yellow?

Replica shards cannot be placed on the same node as their primary. On a one-node lab, set number_of_replicas to 0.

How do I test a Logstash configuration?

Run bin/logstash -f yourfile.conf --config.test_and_exit to check syntax, and use a stdin input with a rubydebug stdout output to see how filters change an event.

Which ports does the ELK Stack use?

Elasticsearch uses 9200 for HTTP and 9300 for node transport, Kibana uses 5601, the Logstash monitoring API uses 9600, and 5044 is the usual Beats input port.

Do I need to learn ES|QL for interviews?

It is not always asked, but it is generally available since 8.14 and used in Kibana Discover, so a simple FROM, WHERE, STATS query is worth knowing.

What is the difference between dissect and grok?

Dissect splits text by fixed delimiters and is fast and simple. Grok uses regular expression patterns and handles irregular formats, at a higher CPU cost.

Official references

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.