@grafana/data#getParser TypeScript Examples

The following examples show how to use @grafana/data#getParser. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LogDetails.tsx    From grafana-chinese with Apache License 2.0 6 votes vote down vote up
parseMessage = memoizeOne((rowEntry): FieldDef[] => {
    const parser = this.getParser(rowEntry);
    if (!parser) {
      return [];
    }
    // Use parser to highlight detected fields
    const parsedFields = parser.getFields(rowEntry);
    const fields = parsedFields.map(field => {
      const key = parser.getLabelFromField(field);
      const value = parser.getValueFromField(field);
      return { key, value };
    });

    return fields;
  });
Example #2
Source File: LogDetails.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
getParser = memoizeOne(getParser);
Example #3
Source File: LogDetails.tsx    From grafana-chinese with Apache License 2.0 5 votes vote down vote up
getStatsForParsedField = (key: string) => {
    const matcher = this.getParser(this.props.row.entry)!.buildMatcher(key);
    return calculateFieldStats(this.props.getRows(), matcher);
  };