Learn how to pipe Lightrun Logs to Sumo Logic with the Sumo Logic OpenTelemetry (OTEl) collector.¶
Sumo Logic is a popular cloud-native logging tool that makes gaining valuable insights from your log data easy. By integrating Lightrun with Sumo Logic, you can insert real-time dynamic logs into your live application with Lightrun and send the collected logs to the Sumo Logic platform for visualization and fast analysis.
This tutorial assumes that you have:
- A Lightrun account. Create your free Lightrun account.
- A Sumo Logic account. Register for a free Sumo Logic account here.
Install Sumo Logic OpenTelemetry(OTel) collector¶
This tutorial's first step is installing the Sumo Logic OpenTelemetry(OTel) collector on your local machine. When you create a new account with Sumo Logic, you will be directed to their onboarding page with the installation instructions. Run the Sumo Logic OpenTelemetry collector and dashboards installer code to complete the installation step.
Configure Sumo Logic OTel collector¶
After completing the installation step, the next step in this tutorial is to configure the Sumo Logic OTel collector to collect Lightrun logs and send the collected logs to Sumo Logic for analysis.
To do that,
- Create a
Add the following YAML to the file.
receivers: filelog/custom_files: include: - /tmp/lightrun_file_handler_logs1.log include_file_name: false include_file_path_resolved: true storage: file_storage operators: - type: json_parser parse_to: body if: 'attributes["log.file.path_resolved"] matches "/tmp/.*"' start_at: beginning processors: groupbyattrs/file path resolved: keys: - log.file.path_resolved service: pipelines: logs/custom_files: receivers: - filelog/custom_files processors: - memory_limiter - groupbyattrs/file path resolved - resourcedetection/system - batch exporters: - sumologic
%TEMP%on Windows OS.
lightrun.yamlfile to the
/etc/otelcol-sumo/conf.ddirectory or appropriate location for your operating system; see the Sumo Logic documentation for more information.
$ sudo mv lightrun.yaml /etc/otelcol-sumo/conf.d
Run the OpenTelemetry installer.
$ sudo otelcol-sumo --config=/etc/otelcol-sumo/sumologic.yaml --config "glob:/etc/otelcol-sumo/conf.d/*.yaml"
Confirm your integration¶
To confirm your integration:
Change your log file handler format to JSON in your agent configuration and restart your Lightrun agent.
Insert a Lightrun dynamic log into your code base.
- Log in to Sumo Logic and navigate to Manage Data > Collection > Open Telemetry Collection.
- Select your collector and click the Open in Log Search button.
- You should be able to view and analyze your Lightrun logs.