{"id":126,"date":"2015-01-15T13:07:33","date_gmt":"2015-01-15T13:07:33","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=126"},"modified":"2017-01-31T12:13:16","modified_gmt":"2017-01-31T12:13:16","slug":"input-modules","status":"publish","type":"page","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=126","title":{"rendered":"Input modules"},"content":{"rendered":"<p>The purpose of input modules is to read data from a source and cut into into Orchids events, namely certain records of field\/value pairs.<\/p>\n<p>A typical example is the <a title=\"The textfile module\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=87\">textfile<\/a> module, which reads data from a file, a pipe, or a Unix socket, and returns one event per text line; or the <a title=\"The udp module\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=171\">udp<\/a> module, which reads raw packets of data from a UDP connection; or the <a title=\"The bintotext module\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=121\">bintotext<\/a> module, which takes an Orchids event and converts its last field, which is a raw binary string, into sequences of text lines.<\/p>\n<p>The fields declared by an input module must be at least two, and the last two play a special role:<\/p>\n<ul>\n<li>The <strong>last field<\/strong> is the one that <a title=\"Dissection modules\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=131\">dissection modules<\/a> may dissect.\u00a0 For example, the last field provided by <a title=\"The textfile module\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=87\">textfile<\/a> is called <code>.textfile.line<\/code>, and contains the last line read from the given file.<\/li>\n<li>The <strong>next-to-last field<\/strong> is the dissection key, or tag.\u00a0 It is used by Orchids to decide what <a title=\"Dissection modules\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=131\">dissection module<\/a> (if any) should be used to parse the last field.\u00a0 For example, the next-to-last field provided by <a title=\"The textfile module\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=87\">textfile<\/a> is called <code>.textfile.file<\/code>; it contains the name of the file, pipe, or Unix socket from which the event was obtained, and depending on it, Orchids can be configured to parse lines coming from that source using the <code>syslog<\/code> or the <code>generic<\/code> module, say.<\/li>\n<\/ul>\n<p>Every input module also provides an <code>INPUT<\/code> configuration directive, so that one could in principle write, inside <em>nn<\/em><code>_mod_textfile.conf<\/code>, one or several lines of the form `<code>INPUT <\/code><em>file&#8217;<\/em>.\u00a0 That is frowned upon.\u00a0 Instead, you should write <code>INPUT<\/code> directives in the <a title=\"orchids-inputs.conf\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=145\"><code>orchids-inputs.conf<\/code><\/a> file. They have the slightly different syntax `<code>INPUT <\/code><em>module-name<\/em> <em>file&#8217;<\/em> there, and this is completely synonymous with writing `<code>INPUT <\/code><em>file&#8217;<\/em> between `<code>&lt;module <\/code><em>module-name<code>&gt;'<\/code><\/em> and `<code>&lt;\/module&gt;'<\/code>.\u00a0 The point is that the whole plumbing should be described in the single file <a title=\"orchids-inputs.conf\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=145\"><code>orchids-inputs.conf<\/code><\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The purpose of input modules is to read data from a source and cut into into Orchids events, namely certain records of field\/value pairs. A typical example is the textfile module, which reads data from a file, a pipe, or a Unix socket, and returns one event per text line; or the udp module, which &hellip; <a href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=126\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Input modules<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-126","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=126"}],"version-history":[{"count":7,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages\/126\/revisions"}],"predecessor-version":[{"id":552,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages\/126\/revisions\/552"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}