Record Class ParsedLogQuery

java.lang.Object
java.lang.Record
codes.grow.packages.skywalking.ParsedLogQuery
Record Components:
service - service name, or empty
instance - instance name, or empty
endpoint - endpoint name, or empty
traceId - related trace id, or empty
tags - server-side tag filters
text - free-text terms, matched client side

public record ParsedLogQuery(Optional<String> service, Optional<String> instance, Optional<String> endpoint, Optional<String> traceId, Map<String,String> tags, List<String> text) extends Record
Parsed form of a SkyWalkingLogQueryClient query: space-separated key=value terms (service=, instance=, endpoint=, trace_id=/traceId= map to the GraphQL condition; any other key is a server tag filter and must be in SW_SEARCHABLE_LOGS_TAG_KEYS) plus free-text terms ("quoted phrases" allowed). Every free-text term must occur (case-insensitive) in the content or in a tag value.
  • Constructor Details

  • Method Details

    • parse

      public static ParsedLogQuery parse(String query)
      Parses a query (see the record description).
      Parameters:
      query - query text (null = everything)
      Returns:
      the parsed query
    • matchesText

      public boolean matchesText(NativeLog log)
      Whether every free-text term occurs (case-insensitive) in the log content or a tag value.
      Parameters:
      log - stored log
      Returns:
      true when the log matches
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • service

      public Optional<String> service()
      Returns the value of the service record component.
      Returns:
      the value of the service record component
    • instance

      public Optional<String> instance()
      Returns the value of the instance record component.
      Returns:
      the value of the instance record component
    • endpoint

      public Optional<String> endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • traceId

      public Optional<String> traceId()
      Returns the value of the traceId record component.
      Returns:
      the value of the traceId record component
    • tags

      public Map<String,String> tags()
      Returns the value of the tags record component.
      Returns:
      the value of the tags record component
    • text

      public List<String> text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component