Ad Widget

Collapse

Create a graph from log file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • drevns
    Junior Member
    • Dec 2019
    • 4

    #1

    Create a graph from log file

    I am new to Zabbix and need some help. I have a log file (sample of contents below). From this log file, I want to create a graph from all the contents using all the data.

    user date time wait time execution time server
    user03 2019-10-19 05:19:59.162679 0.208916 0.334641 server-01-598bc948cc-r44j4-20191021
    user03 2019-10-19 05:20:00.071890 0.203622 0.356399 server-01-598bc948cc-r44j4-20191021
    user03 2019-10-19 05:20:00.508373 0.238079 0.351551 server-01-598bc948cc-r44j4-20191021

    I used item to get the entire contents of the file in Zabbix log[/logs/output.log].

    How can I create a graph?
  • gofree
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2017
    • 400

    #2
    Extracting matching part of regular expression

    Comment

    • drevns
      Junior Member
      • Dec 2019
      • 4

      #3
      I actually saw that and tried it, but not getting the result I want. Probably I have the incorrect syntax. I want to get the each field value separately for example log[/logs/output.log,"user*",,,,] (don't know if its correct) should just return user01 and/or user02 etc, then the date field, then the remaining fields. After which I use them to create a graph.

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        I can't find the string user in the log you posted. Please provide the actual log format and specific examples of the values you want to retrieve.

        Comment

        • drevns
          Junior Member
          • Dec 2019
          • 4

          #5
          This is a sample of the log file. The data is represented in the order user, date, time, wait time, execution time and server.

          user01 2019-10-19 05:19:59.162679 0.208916 0.334641 server-01-598bc948cc-r44j4-20191021
          user03 2019-10-19 05:20:00.071890 0.203622 0.356399 server-02-74cf287434-r44j4-20191021
          user03 2019-10-19 05:21:00.508373 0.238079 0.351551 server-04-9875fae356-r44j4-20191021
          user02 2019-10-19 05:22:59.162679 0.208916 0.334641 server-02-74cf287434-r44j4-20191021
          user01 2019-10-19 05:23:00.071890 0.203622 0.356399 server-03-92256c25aa-r44j4-20191021
          user03 2019-10-19 05:24:00.508373 0.238079 0.351551 server-01-598bc948cc-r44j4-20191021

          I want to graph the data above. The string user is actually user01, user02 or user03. The graph should represent user, date, time, wait time, execution time and server.

          Comment

          • Hamardaban
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • May 2019
            • 2713

            #6
            For your understanding: graphs are built on numeric data, not on strings.
            In order to display the data on the chart, you need to select it in the data element- “item”.
            In your case, you need / can create multiple dependent data items, each of which will represent a specific metric. and then collect them on the charts .
            In the dependent element extract the numeric data you need using regex.

            Comment

            • drevns
              Junior Member
              • Dec 2019
              • 4

              #7
              Therefore, user01 can be 1 and server04 can be 400. Now, how would i represent the date 2019-10-19. This is tricky for me. A sample would be helpful.

              Comment

              Working...