Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-10773

flowDocument.getTimestamp() returning time based on system timezone and not UTC

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 22.0.0
    • Fix Version/s: 22.0.0
    • Component/s: None
    • Security Level: Default (Default Security Scheme)
    • Labels:
    • Sprint:
      Horizon - March 21st 2018, Horizon - March 21st 2018

      Description

      When flowDocument.getTimestamp() is used to get the time, the function returns the flows time converted into the system timezone and not UTC. This causes the flow to be logged against the incorrect index.

      Ref: https://github.com/OpenNMS/opennms/blob/4d66d7c9ffaee96b46fea06315b67dff81183b02/features/flows/elastic/src/main/java/org/opennms/netmgt/flows/elastic/ElasticFlowRepository.java#L166

      Elastic document stored from OpenNMS, epoch time comments added for clarity

      \{
      "_index": "netflow-2018-03-27-21",
      "_type": "netflow",
      "_id": "xcGHWmIBosnUJRExydWZ",
      "_score": 1,
      "_source": \{
      "@timestamp": 1522205705000, // UTC Wednesday, March 28, 2018 2:55:05 AM - CDT Tuesday, March 27, 2018 9:55:05 PM GMT-05:00 DST
      "@version": 1,
      "host": "<REDACTED>",
      "location": "Minion-Location-1",
      "netflow.application": "omnivision",
      "netflow.bytes": 80,
      "netflow.convo_key": """["Minion-Location-1",6,"<REDACTED>",2101,"<REDACTED>",1135]""",
      "netflow.direction": "ingress",
      "netflow.dst_addr": "<REDACTED>",
      "netflow.dst_as": 0,
      "netflow.dst_locality": "private",
      "netflow.dst_mask_len": 26,
      "netflow.dst_port": 2101,
      "netflow.engine_id": 0,
      "netflow.engine_type": 0,
      "netflow.first_switched": 1522205703146, // UTC: Wednesday, March 28, 2018 2:55:03.146 AM - CDT Tuesday, March 27, 2018 9:55:03.146 PM GMT-05:00 DST
      "netflow.flow_locality": "private",
      "netflow.flow_records": 9,
      "netflow.flow_seq_num": 611550647,
      "netflow.initiator": false,
      "netflow.input_snmp": 10,
      "netflow.ip_protocol_version": 4,
      "netflow.last_switched": 1522205704654, // UTC: Wednesday, March 28, 2018 2:55:04.654 AM - CDT Tuesday, March 27, 2018 9:55:04.654 PM GMT-05:00 DST
      "netflow.next_hop": "<REDACTED>",
      "netflow.output_snmp": 16,
      "netflow.packets": 2,
      "netflow.protocol": 6,
      "netflow.sampling_interval": 0,
      "netflow.src_addr": "<REDACTED>",
      "netflow.src_as": 64809,
      "netflow.src_locality": "private",
      "netflow.src_mask_len": 24,
      "netflow.src_port": 1135,
      "netflow.tcp_flags": 16,
      "netflow.tos": 0,
      "netflow.version": "Netflow v5"
      }
      }
      

       

        Attachments

          Activity

            People

            Assignee:
            mvr Markus von Rüden
            Reporter:
            sean Sean Torres
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: