# Trying to read logs through opentelemetry and data prepper but facing an error

**URL:** https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248
**Category:** Open Source Elasticsearch and Kibana
**Tags:** discuss
**Created:** [March 5, 2024, 7:37am UTC](https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248 "2024-03-05T07:37:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rjain1328](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@rjain1328](https://forum.opensearch.org/u/rjain1328)
#### Post date: [March 5, 2024, 7:37am UTC](https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248/1 "2024-03-05T07:37:41Z")

</div>

Hi Team…  
Can anyone help me out ?

For POC i have setup (Opensearch, Kafka,Opentelemetry,Data prepper). in one server.

My All services are running fine but when i am doing curl command to opensearch to get the index doc Its not showing the reason is Data prepper is not able to get the logs through opentelemetry.

* * *

Data prepper files:

## otel-log-pipelines.yaml

otel-logs-pipeline:  
source:  
otel\_logs\_source:  
port: 21892  
ssl: false  
buffer:  
kafka:  
bootstrap\_servers: [“localhost:9092”]  
encryption:  
type: none  
topics:  
- name: opensearch-events  
group\_id: otel-data-prepper  
create\_topic: true  
sink:  
- opensearch:  
hosts: [“[https://localhost:9200](https://localhost:9200)” ]  
insecure: true  
username: admin  
password: #####  
index: otel\_logs

* * *

And Otel files:

## cat otel-config.yaml

receivers:  
filelog:  
include: [/home/jainrahul01/opensearch-data-prepper/file.log]  
operators:  
- type: json\_parser  
parse\_from: body

exporters:  
otlp/data-prepper:  
endpoint: #########  
tls:  
insecure: true  
insecure\_skip\_verify: true  
logging:

service:  
pipelines:  
logs:  
receivers: [filelog]  
exporters: [logging,otlp/data-prepper]

* * *

Logs for data prepper:

://github.com/opensearch-project/data-prepper/tree/main/data-prepper-plugins/otel-logs-source#ssl  
2024-05-24T15:04:57,530 [otel-logs-pipeline-sink-worker-2-thread-1] INFO org.opensearch.dataprepper.plugins.source.otellogs.OTelLogsSource - Started otel\_logs\_source…  
2024-05-24T15:04:57,530 [otel-logs-pipeline-sink-worker-2-thread-1] INFO org.opensearch.dataprepper.pipeline.Pipeline - Pipeline [otel-logs-pipeline] - Submitting request to initiate the pipeline processing

* * *

Logs for otel:

2024-05-24T15:06:18.576Z warn localhostgate/featuregate.go:63 The default endpoints for all servers in components will change to use localhost instead of 0.0.0.0 in a future version. Use the feature gate to preview the new default. {“feature gate ID”: “component.UseLocalHostAsDefaultHost”}  
2024-05-24T15:06:18.776Z info fileconsumer/file.go:228 Started watching file {“kind”: “receiver”, “name”: “filelog”, “data\_type”: “logs”, “component”: “fileconsumer”, “path”: “/home/jainrahul01/opensearch-data-prepper/file.log”}

* * *

curl -k -u admin -XGET [https://localhost:9200/otel\_logs/\_search?pretty=true](https://localhost:9200/otel_logs/_search?pretty=true)  
Enter host password for user ‘admin’:  
{  
“took” : 1,  
“timed\_out” : false,  
“\_shards” : {  
“total” : 1,  
“successful” : 1,  
“skipped” : 0,  
“failed” : 0  
},  
“hits” : {  
“total” : {  
“value” : 0,  
“relation” : “eq”  
},  
“max\_score” : null,  
“hits” :   
}  
}

---

<div class="post-metadata">

### Author: ![hm21](https://avatars.discourse-cdn.com/v4/letter/h/8dc957/32.png) [@hm21](https://forum.opensearch.org/u/hm21)
#### Post date: [March 5, 2024, 10:50am UTC](https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248/2 "2024-03-05T10:50:58Z")

</div>

Data Prepper - You can find more information here:

[opensearch-project/data-prepper: Data Prepper is a component of the OpenSearch project that accepts, filters, transforms, enriches, and routes data at scale. (github.com)](https://github.com/opensearch-project/data-prepper)

[Data Prepper vs. Logstash: Overview, Components, Usage & More (opster.com)](https://opster.com/guides/elasticsearch/data-architecture/data-prepper-vs-logstash/)

---

<div class="post-metadata">

### Author: ![johnny004](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@johnny004](https://forum.opensearch.org/u/johnny004)
#### Post date: [March 19, 2024, 7:57pm UTC](https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248/3 "2024-03-19T19:57:48Z")

</div>

Fluentd, Filebeat, vector are the alternatives to logstash.

---

<div class="post-metadata">

### Author: ![johntk22](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@johntk22](https://forum.opensearch.org/u/johntk22)
#### Post date: [March 21, 2024, 10:43pm UTC](https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248/4 "2024-03-21T22:43:39Z")

</div>

Yes Fluentd is an opensource alternative for logstash. It is an robust and log collector, that allows you to collect praise, filter, route logs from source to destination form.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)
#### Post date: [May 20, 2024, 10:44pm UTC](https://forum.opensearch.org/t/trying-to-read-logs-through-opentelemetry-and-data-prepper-but-facing-an-error/18248/5 "2024-05-20T22:44:04Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
