pione log format

提供: Eospedia
移動: 案内検索

pione log formatとはログを別のフォーマットとして変換するPIONEコマンドです。

オプション一覧

オプション デフォルト 説明
引数 location 必須 ログファイルの場所
--format NAME xes フォーマット: xes, json, xml(現状はxesのみ)
--log-id ID 最新のID 出力するID: (参照: pione log list-id)
--trace-type NAME 全てのトレース 出力するトレース: "agent", "rule", or "task"
--agent-type NAME 全てのエージェント 出力するエージェント名: "task_worker", "input_generator", ... (trace-type="agent"のときのみ有効)
--color BOOLEAN true 出力結果の文字に色を付ける
--debug [TYPE] system デバッグモードで実行
-h [FORMAT] txt ヘルプを表示
-v なし なし バージョンを表示

実行例

オプション必須項目のみの場合

こちらのファイルを引数としてコマンドを実行します。

$ pione log format pione-process.log
<?xml version='1.0'?>
<log xes.version='1.4' xes.features='nested-attributes' openxes.version='1.0RC7' xmlns='http://www.xes-standard.org/'>
  <extension name='Concept' prefix='concept' uri='http://www.xes-standard.org/concept.xesext'/>
  <extension name='Identity' prefix='identity' uri='http://www.xes-standard.org/identity.xesext'/>
  <extension name='Time' prefix='time' uri='http://www.xes-standard.org/time.xesext'/>
  <extension name='Lifecycle' prefix='lifecycle' uri='http://www.xes-standard.org/lifecycle.xesext'/>
  <extension name='Organizational' prefix='org' uri='http://www.xes-standard.org/org.xesext'/>
  <classifier name='MXML Legacy Classifier' keys='concept:name lifecycle:transition'/>
  <classifier name='Event Name' keys='concept:name'/>
  <classifier name='Resource' keys='org:resource'/>
  <string key='concept:name' value='PIONE process log'/>
  <trace>
    <string key='pione:traceType' value='agent_activity'/>
    <id key='identity:id' value='7b6ce82a-9e6a-4082-8d09-f30d962b1987'/>
    <event>
      <string key='concept:name' value='init'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.001+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>
    <event>
      <string key='concept:name' value='init'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.001+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
    </event>

-中略-

  <trace>
    <string key='concept:name' value='task process 14fd9012-294b-4596-8989-46bb4ca3a95f'/>
    <string key='pione:traceType' value='task_process'/>
    <event>
      <string key='concept:name' value='&Anonymous:Root([],{})'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.105+09:00'/>
      <string key='lifecycle:transition' value='start'/>
      <string key='pione:ruleType' value='flow'/>
      <string key='pione:inputs' value=''/>
      <string key='pione:parameters' value='{}'/>
    </event>
    <event>
      <string key='concept:name' value='&Anonymous:Root([],{})'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.115+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
      <string key='pione:ruleType' value='flow'/>
      <string key='pione:inputs' value=''/>
      <string key='pione:parameters' value='{}'/>
    </event>
  </trace>
</log>

XES形式への変換結果がそのまま標準出力されます。

ファイル保存するときは下記のようにします。(このとき、拡張子名は.xesでなければ正常にProMで正常に読み込めない場合がありますので、注意して下さい)

$ pione log format pione-process.log > pione-process.xes


オプション --log-id

pione log list-idで出力されるIDから選択することで出力するログを指定することができます。(デフォルトでは最新のIDが出力される)

$ pione log format pione-process.log --log-id "2014-12-22T11:33:53.016+09:00"
<?xml version='1.0'?>
<log xes.version='1.4' xes.features='nested-attributes' openxes.version='1.0RC7' xmlns='http://www.xes-standard.org/'>
  <extension name='Concept' prefix='concept' uri='http://www.xes-standard.org/concept.xesext'/>
  <extension name='Identity' prefix='identity' uri='http://www.xes-standard.org/identity.xesext'/>
  <extension name='Time' prefix='time' uri='http://www.xes-standard.org/time.xesext'/>
  <extension name='Lifecycle' prefix='lifecycle' uri='http://www.xes-standard.org/lifecycle.xesext'/>
  <extension name='Organizational' prefix='org' uri='http://www.xes-standard.org/org.xesext'/>
  <classifier name='MXML Legacy Classifier' keys='concept:name lifecycle:transition'/>
  <classifier name='Event Name' keys='concept:name'/>
  <classifier name='Resource' keys='org:resource'/>
  <string key='concept:name' value='PIONE process log'/>
  <trace>
    <string key='pione:traceType' value='agent_activity'/>
    <id key='identity:id' value='4829ddd4-e931-4daf-8131-466238d52ad7'/>
    <event>
      <string key='concept:name' value='init'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:33:53.032+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>
    <event>
      <string key='concept:name' value='stop_iteration'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:33:53.033+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>

-中略-

    <event>
      <string key='concept:name' value='&Anonymous:Root([],{})'/>
      <date key='time:timestamp' value='2014-12-22T11:33:53.835+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
      <string key='pione:ruleType' value='flow'/>
      <string key='pione:inputs' value=''/>
      <string key='pione:parameters' value='{}'/>
    </event>
    <event>
      <string key='concept:name' value='&Anonymous:Main([],{})'/>
      <date key='time:timestamp' value='2014-12-22T11:33:53.851+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
      <string key='pione:ruleType' value='action'/>
      <string key='pione:inputs' value=''/>
      <string key='pione:parameters' value='{O:<(<i>1)=>(<d>'message.txt')>}'/>
    </event>
  </trace>
</log>

他のIDのログが出力されています。

オプション --trace-type

出力するログのtraceを指定します。

$ pione log format pione-process.log --trace-type "task"
<?xml version='1.0'?>
<log xes.version='1.4' xes.features='nested-attributes' openxes.version='1.0RC7' xmlns='http://www.xes-standard.org/'>
  <extension name='Concept' prefix='concept' uri='http://www.xes-standard.org/concept.xesext'/>
  <extension name='Identity' prefix='identity' uri='http://www.xes-standard.org/identity.xesext'/>
  <extension name='Time' prefix='time' uri='http://www.xes-standard.org/time.xesext'/>
  <extension name='Lifecycle' prefix='lifecycle' uri='http://www.xes-standard.org/lifecycle.xesext'/>
  <extension name='Organizational' prefix='org' uri='http://www.xes-standard.org/org.xesext'/>
  <classifier name='MXML Legacy Classifier' keys='concept:name lifecycle:transition'/>
  <classifier name='Event Name' keys='concept:name'/>
  <classifier name='Resource' keys='org:resource'/>
  <string key='concept:name' value='PIONE process log'/>
  <trace>
    <string key='concept:name' value='task process 84620115-f487-4540-beac-28abeb735086'/>
    <string key='pione:traceType' value='task_process'/>
    <event>
      <string key='concept:name' value='&Anonymous:Root([],{})'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.105+09:00'/>
      <string key='lifecycle:transition' value='start'/>
      <string key='pione:ruleType' value='flow'/>
      <string key='pione:inputs' value=''/>
      <string key='pione:parameters' value='{}'/>
    </event>
    <event>
      <string key='concept:name' value='&Anonymous:Root([],{})'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.115+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
      <string key='pione:ruleType' value='flow'/>
      <string key='pione:inputs' value=''/>
      <string key='pione:parameters' value='{}'/>
    </event>
  </trace>
</log>

task_processのtraceのみが出力されています。

オプション --agent-type

trace-type=agentのときに出力するログのエージェントを指定します。

$ pione log format pione-process.log --trace-type "agent" --agent-type "input_generator"
<?xml version='1.0'?>
<log xes.version='1.4' xes.features='nested-attributes' openxes.version='1.0RC7' xmlns='http://www.xes-standard.org/'>
  <extension name='Concept' prefix='concept' uri='http://www.xes-standard.org/concept.xesext'/>
  <extension name='Identity' prefix='identity' uri='http://www.xes-standard.org/identity.xesext'/>
  <extension name='Time' prefix='time' uri='http://www.xes-standard.org/time.xesext'/>
  <extension name='Lifecycle' prefix='lifecycle' uri='http://www.xes-standard.org/lifecycle.xesext'/>
  <extension name='Organizational' prefix='org' uri='http://www.xes-standard.org/org.xesext'/>
  <classifier name='MXML Legacy Classifier' keys='concept:name lifecycle:transition'/>
  <classifier name='Event Name' keys='concept:name'/>
  <classifier name='Resource' keys='org:resource'/>
  <string key='concept:name' value='PIONE process log'/>
  <trace>
    <string key='pione:traceType' value='agent_activity'/>
    <id key='identity:id' value='7b6ce82a-9e6a-4082-8d09-f30d962b1987'/>
    <event>
      <string key='concept:name' value='init'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.001+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>
    <event>
      <string key='concept:name' value='init'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.001+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
    </event>
    <event>
      <string key='concept:name' value='stop_iteration'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.002+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>
    <event>
      <string key='concept:name' value='generate'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.002+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>
    <event>
      <string key='concept:name' value='stop_iteration'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.002+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
    </event>
    <event>
      <string key='concept:name' value='terminate'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.002+09:00'/>
      <string key='lifecycle:transition' value='start'/>
    </event>
    <event>
      <string key='concept:name' value='terminate'/>
      <string key='org:resource' value='input_generator'/>
      <date key='time:timestamp' value='2014-12-22T11:48:13.002+09:00'/>
      <string key='lifecycle:transition' value='complete'/>
    </event>
  </trace>
</log>