Telegraf Encoding utf-8

Hello, and thank you in advance for any help you may provide.

I have influxdb and telegraf running and collecting data.

When collecting CPU data of the physical machine through telegraf, the collected data are all garbled in the log

like that nable to parse '�Uz%': missing fields tn8�[Z �h>�|,>�d&"���m�ج���sc�7S!���L�%�}�I9"
9:���J����y���O8"���)+�’���kIyآVd��D;‘m���e��U��t]-�)�T��}�ڮ֬n�{��l6>fʔ,����1&��R;M����[+�ՙ’JO���P��Kh��V��t2ɣ�����e�B���t�2=(�X�l���
��^�)�IT� Cr�9�Ī��f�NG$!0���A� Y�T��;uHE
�ΐ�"�G� ]L��sv �^�MJ�?kE�U4�:�2���A"�����X.���3�*$�J��8B�TG�O'C�D�-BЂ��v���H': invalid field format unable to parse '2/��b-�� ��r6yL���jB��!
�q’: invalid field format
unable to parse ’
r9�<&U�]ڔ� O�’: invalid field format���iu��Sΐi���"-
unable tA��B�ABD 3�"$+�i^�?����T�������Y�=���pgV��+�Q�h�����v���s��HV��=�}%\�b��dF"u�WIb�ut2���e�b�2�B?��"�����a���p�}�8_,X������&��S�b�iĂ��Ԍڧ�D�I,W$�)�@��1 �K( a���-���Haڲd���zp6����.���!LO��'V:Q�e': invalid boolean unable to parse '��Ò����.��qocv�Pu�3 >�����3�Hn�M5] �,�V߼��2D�]�8^N����)��F��C��>�N2�ӧ)��l3��x�í��.A:��e�"*"(�꘨h�)�f{D�Ⲗ�> ��g�q�!��fnBu��I�t@��&D;��J9�|�,�4Q� a��P���D�H�-ı���P��r�«!����+���^�1�:����o�-1����9�]�C�(�+��’: missing tag value
unable to parse '11��q
���(TH
Ul%�N��L�@0'�G�}�؎ ���ͤ�� ��"TŪc��^V�;���[e�W�R�P@�a� �)<1w ���J��z��Pe��G�1u2K5� ��t�OsIR�4 ������R��0,Hd�iNn|9��L��z�9
CdB��σ&F�zR@4�YY$��
��.�’: invalid field format
unable to parse '�
': missing fields
2021-11-01T07:41:53Z E! [agent] Error writing to outputs.influxdb: could not write any address
2021-11-01T07:41:53Z I! [agent] Stopping running outputs`

This is my configuration

[global_tags]
[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""
   quiet = false
   logtarget = "file"
   logfile = "/var/log/telegraf/telegraf.log"
  hostname = "test1"
  omit_hostname = false
[[outputs.influxdb]]
urls = ["http://10.20.5.8:8086"]
   database = "iaas_test"
   database_tag = "iaas_test"
   skip_database_creation = true
   user_agent = "telegraf"
[[inputs.cpu]]
  percpu = true
  totalcpu = true
  collect_cpu_time = false
  report_active = false
[[inputs.mem]]

HTTP Content-Encoding for write request body, can be set to “gzip” to

compress body or “identity” to apply no encoding.

content_encoding = “identity”

如果你使用http的方式 发送数据到后端influxdb 默认是不支持gzip的格式的
需要修改这里为 identity

Can you run locale on your system and get the output?

yes i can

I found the answer to the question. I need to set the HTTP sending mode

## HTTP Content-Encoding for write request body, can be set to "gzip" to
## compress body or "identity" to apply no encoding.
content_encoding = "identity"
1 Like

nice! thanks for the follow-up!