// Module included in the following assemblies:
//
// * observability/logging/log_collection_forwarding/cluster-logging-collector.adoc

:_mod-docs-content-type: PROCEDURE
[id="log6x-creating-logfilesmetricexporter_{context}"]
= Creating a LogFileMetricExporter resource

To generate metrics from the logs produced by running containers, you must create a `LogFileMetricExporter` custom resource (CR).

If you do not create the `LogFileMetricExporter` CR, you might see a *No datapoints found* message in the {product-title} web console dashboard for *Produced Logs*.

.Prerequisites

* You have administrator permissions.
* You have installed the {clo}.
* You have installed the {oc-first}.

.Procedure

. Create a `LogFileMetricExporter` CR as a YAML file:
+
.Example `LogFileMetricExporter` CR
[source,yaml]
----
apiVersion: logging.openshift.io/v1alpha1
kind: LogFileMetricExporter
metadata:
  name: instance
  namespace: openshift-logging
spec:
  nodeSelector: {} # <1>
  resources: # <2>
    limits:
      cpu: 500m
      memory: 256Mi
    requests:
      cpu: 200m
      memory: 128Mi
  tolerations: [] # <3>
# ...
----
<1> Optional: The `nodeSelector` stanza defines which pods are scheduled on which nodes.
<2> The `resources` stanza defines resource requirements for the `LogFileMetricExporter` CR.
<3> Optional: The `tolerations` stanza defines the tolerations that the pods accept.

. Apply the `LogFileMetricExporter` CR by running the following command:
+
[source,terminal]
----
$ oc apply -f <filename>.yaml
----
