How to install loki with promtail on san switch?

need i install any add-ons?
i have searched for a while but haven’t found any useful info
can i just deploy it using binaries for Loki ?

any ideas? = =|| or any people have deployed successfully on the switch?

I am not sure if I understand your question correctly.

If you want to gather logs from hardware devices such as a SAN controller or a networking switch, you will need to configure the device to send logs to a syslog service.

You can configure Promtail to act as a syslog service as described here: Promtail only supports receiving syslog messages over TCP so you will probably also need to add a syslog forwarder in front of Promtail. It’s described on the page I’ve linked to.

have you ever met the situation that when I install loki by docker image, and run coddocker run -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.0.0 -config.file=/mnt/config/loki-local-config.yaml
it returns failed parsing config: open /mnt/config/loki-local-config.yaml: no such file or directory
failed parsing config: /mnt/config/loki-local-config.yaml: yaml: unmarshal errors:
line 7: field wal not found in type ingester.Config

The first error, “no such file or directory” occurs if the config file $(pwd)/loki-local-config.yaml is not present on your host. Perhaps you are in the wrong directory when running the docker command?

The second error, “unmarshal errors”, occurs if the config file is missing required fields or in general is invalid. Perhaps your config file was based on an older version of Loki?

i solve the problems now
the first problem occurs when putting the yaml in /root

the second is really strange. I solve it by using loki-docker-config rather than loki-local-config…

however I meet new problem…
when I deploy promtail by daemonset, error occurs
“log”:“Unable to parse config: open /opt/loki/promtail-local-config.yaml: no such file or directory\n”

does that mean I need to write the url as MasterNodeIP: /opt/loki/promtail-local-config.yaml ?
what actually causes this problem? :thinking:

here’s the daemonset.yaml

apiVersion: apps/v1
kind: DaemonSet
name: promtail-daemonset
name: promtail
name: promtail
serviceAccount: promtail-serviceaccount
serviceAccountName: promtail-serviceaccount
- name: logs
path: /var/log
- name: promtail-config
name: promtail-config
- name: k8slog
path: /var/log/pods
- name: promtail-container
image: grafana/promtail
- -config.file=/opt/loki/promtail-local-config.yaml
- name: logs
mountPath: /var/log
- name: promtail-config
mountPath: /opt/loki
- name: k8slog
mountPath: /var/log/pods

This does not have anything to do with MasterNodeIP. The error is that Loki can not find its config file. In the above YAML, you instruct Loki to find it at /opt/loki/promtail-local-config.yaml.

Thus, you need to make sure that the config file is available inside your container at that path.

I see that you have a volumeMount called promtail-config that maps to /opt/loki.

I can’t see how the promtail-config volume is defined but that is where you need to change something.