Jagdish Idhate
Jagdish Idhate

Reputation: 7742

GCP Stackdriver logging: How to put logs in "Global" section?

I have gone though documentation for installing stackdriver agent on linux.

With similar configuration as below of fluentd

$ cat /etc/google-fluentd/config.d/test-structured-log.conf
<source>
    @type tail
    format json
    path /tmp/test-structured-log.log
    pos_file /var/lib/google-fluentd/pos/test-structured-log.pos
    read_from_head true
    tag structured-log
</source>

But my logs are shown in "GCE VM Instace > My-Instance > structured-log"

I'm not able to find documentation where I can set logs in "Global" resource as shown below.

enter image description here

How can I configure my linux instance to put logs in Global?

Upvotes: 0

Views: 791

Answers (1)

Alex6Zam
Alex6Zam

Reputation: 156

Apparently, what you want to do is change the resource type associated to your logs entries. Now Stackdriver is showing exactly the right resource, "GCE VM Instace > Instance-Name > structured-log" so in my opinion that’s the best decision. Global, is a resource type used to indicate that a log is not associated with any specific resource.

If you still want to change it, you will have to explicitly set the resource on your logs entries. See 1 and 2.

Upvotes: 1

Related Questions