code: func (hook *FluentHook) Fire(entry *logrus.Entry) error {
  	var logger *fluent.Fluent
  	var err error
  
  	switch {
  	case hook.Fluent != nil:
  		logger = hook.Fluent
  	default:
  		logger, err = fluent.New(hook.conf.FluentConfig())
  		if err != nil {
  			return err
  		}
  		defer logger.Close()
  	}
  
  	// Create a map for passing to FluentD
  	data := make(logrus.Fields)
  	for k, v := range entry.Data {
  		if _, ok := hook.ignoreFields[k]; ok {
  			continue
  		}
  		if fn, ok := hook.filters[k]; ok {
  			v = fn(v)
  		}
  		data[k] = v
  	}
  
  	setLevelString(entry, data)
  	tag := hook.getTagAndDel(entry, data)
  	if tag != entry.Message {
  		hook.setMessage(entry, data)
  	}
  
  	fluentData := ConvertToValue(data, TagName)
  	err = logger.PostWithTime(tag, entry.Time, fluentData)
  	return err
  }
docs: // Fire is invoked by logrus and sends log to fluentd logger.