func New(beatName string, cfg *common.Config, _ int) (outputs.Outputer, error) {
	config := defaultConfig
	if err := cfg.Unpack(&config); err != nil {
		return nil, err
	}
	cfg.SetInt("flush_interval", -1, -1)
	cfg.SetInt("bulk_max_size", -1, -1)
	output := &fileOutput{beatName: beatName}
	if err := output.init(config); err != nil {
		return nil, err
	}
	return output, nil
}
New instantiates a new file output instance.
package fileout
import (
	"encoding/json"
	"github.com/elastic/beats/libbeat/common"
	"github.com/elastic/beats/libbeat/common/op"
	"github.com/elastic/beats/libbeat/logp"
	"github.com/elastic/beats/libbeat/outputs"
)
func init() {
	outputs.RegisterOutputPlugin("file", New)
}
type fileOutput struct {
	beatName string
	rotator  logp.FileRotator
}