func extractFields()

in action/log/logadapter/elasticsearch.go [158:174]


func extractFields(data map[string]interface{}) []string {
	var allFields []string

	// Iterate through each index to get its field names
	for _, indexData := range data {
		if indexMap, ok := indexData.(map[string]interface{}); ok {
			if mappings, ok := indexMap["mappings"].(map[string]interface{}); ok {
				if properties, ok := mappings["properties"].(map[string]interface{}); ok {
					// Get all field names under "fields" and merge into the result
					allFields = append(allFields, getFieldNames(properties, "")...)
				}
			}
		}
	}

	return allFields
}