modified td-agent cookbook.