Class: Fluentd::Settings::OutForwardController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/fluentd/settings/out_forward_controller.rb

Instance Method Summary collapse

Instance Method Details

#finishObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/fluentd/settings/out_forward_controller.rb', line 15

def finish
  @setting = Fluentd::Setting::OutForward.new(setting_params)
  unless @setting.valid?
    return render "show"
  end

  @fluentd.agent.config_append @setting.to_config
  if @fluentd.agent.running?
    unless @fluentd.agent.restart
      @setting.errors.add(:base, @fluentd.agent.log_tail(1).first)
      return render "show"
    end
  end
  redirect_to daemon_setting_path(@fluentd)
end

#showObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/fluentd/settings/out_forward_controller.rb', line 5

def show
  @setting = Fluentd::Setting::OutForward.new({
    secondary: {
      "0" => {
        type: "file",
      }
    }
  })
end