<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Conceptual Modelling of Log Files: From a UML-based Design to JSON Files?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Evelina Rakhmetova</string-name>
          <email>evelina.rakhmetova@univr.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carlo Combi</string-name>
          <email>carlo.combi@univr.it</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrea Fruggi</string-name>
          <email>andrea.fruggi@sia.eu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>SIA s.r.l.</institution>
          ,
          <addr-line>Verona</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Verona</institution>
          ,
          <addr-line>Str. le Grazie, 15, 37134 Verona</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <fpage>13</fpage>
      <lpage>18</lpage>
      <abstract>
        <p>In this paper, we describe an application of a recently proposed comprehensive UML-based (Uni ed Modeling Language) approach to the conceptual modelling of log les. On the real example, we built an ad hoc UML-based (class) diagram to represent the key features of the logs nested structure and generated an artifact (a template in JSON) based on ECS (Elastic Common Schema). We also describe plans for designing a specialized tool through a conjunction of the already developed artifacts. Presented work is a part of a broader study on the proposed initiative for the general concept of log les standardization. A clear structure of log data would allow more systematic development and more straightforward implementation and employment of the latest information systems, minimize anomalies, errors, and time delays.</p>
      </abstract>
      <kwd-group>
        <kwd>Conceptual Modelling</kwd>
        <kwd>UML</kwd>
        <kwd>JSON</kwd>
        <kwd>Log Files</kwd>
        <kwd>Elastic Common Schema</kwd>
        <kwd>Modelling Tool</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The stable work of information systems, with the constantly increasing
complexity, and security of a tremendous amount of data, they are processing, profoundly
rely on log les management. A log message is a piece of information produced
during the work of the computer system or software, generated as a response to a
running process or an action. The information pulled out of the log message
provides an idea of the log message meaning and the reason for it being generated.
Despite that modern log les management systems are powerful mechanisms
for resolving issues of the IT industry generally, a growing number of custom
solutions make every case rather particular [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        Nowadays the practice of fast development and customization of applications
leads to the situation when logs semantics is not always clear. Such messages do
? Our work is performed with the support and in the interests of the company SIA
s.r.l., the provider of information technology solutions in the banking domain. The
authors are particularly thankful to Daniele Spinelli (daniele.spinelli@sia.eu).
Copyright © 2021 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
not give a distinct perception of processes and interfere with further analysis,
hence, are not quite valuable. Even more challenging to keep track of di erent
log le formats in large heterogeneous systems in which software and devices are
dynamic in nature [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        We declare an intention to limit heterogeneity in log les management by
proposing a standardization of the log les through developing a conceptual
modelling approach and a suitable tool. Conceptual data modelling provides
analysts and designers with a high-level representation of the real world and
an e cient way to communicate with each other. Such data models promote
understanding of the real-world domain and enhance the ability to meet users'
requirements [
        <xref ref-type="bibr" rid="ref1 ref3">1, 3</xref>
        ]. A key problem in log le design is the absence of a widely
accepted conceptual model.
      </p>
      <p>
        Based on the study and scienti c literature review, we have determined a lack
of studies on conceptual log les modelling [
        <xref ref-type="bibr" rid="ref1 ref2 ref7">1, 2, 7</xref>
        ]. There are standardized log
les of systems and widely used commercial schemes, but there is no accepted
methodology for the development of a log-based system, which could be applied
everywhere [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>
        In this paper we describe a comprehensive general approach to conceptual
modelling of log data with a UML-like [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] graphical representation
compatible with ELK stack (Elasticsearch, Logstash, Kibana) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], elaborate on the rst
stages of work and then discuss the usage of the UML-based modelling approach
and the developed python script (for generating logs templates and
documentation). We also outline the future tasks for the tool development.
2
      </p>
      <p>Applied Approach and Features to Conceptual
Modelling Log Files
Our choice to establish log les conceptual modelling on extended UML-based
(class) diagrams and on JSON is based on the following motivations:
{ The UML graphical notation is commonly used over decades; it is structured
and easily understandable by various users.
{ Recently the JSON format has widely emerged as the most convenient
standardized format for structuring data such as log les.
{ JSON is relatively (with respect to other structured formats) compact,
exible, as almost every programming language can parse it, and human-readable.
2.1</p>
    </sec>
    <sec id="sec-2">
      <title>Requirements for Logs</title>
      <p>Since log les are mostly created automatically, as a minimum log data must
include date/time stamp, description of the event and information unique to that
event, in order to provide information to bene t further analysis,
troubleshooting processes or data breach investigation. Information must be structured and
suitable for running data analysis with the use of various tools.</p>
    </sec>
    <sec id="sec-3">
      <title>JSON Log Files Formation</title>
      <p>JSON logging provides more exibility to the current logging system, especially
when migration from the text logging format (as most common and unsettled
format) to JSON can be simply performed. There is currently a vast number of
frameworks and programming language drivers that support the translation of
log data in JSON format if it was not initially the case. This shows the tendency
of the industry to a standardized format for structuring such kinds of data.</p>
      <p>
        One of the advantages - JSON is simple to implement in languages
without built-in JSON functionality. It is important to highlight that on the
metadata level ECS (Elastic Common Schema) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] is speci ed through YAML format
documentation (git repository), following, we will transform this for usability
purposes in JSON format.
2.3
      </p>
    </sec>
    <sec id="sec-4">
      <title>An Ad Hoc UML-based Diagram Modelling Approach</title>
      <p>
        An application of the recently proposed approach [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] allows the representation of
log les data structure in a more powerful way, thus providing a sound description
of log-based systems. The extended UML-based modelling approach considers
the use of suitable stereotypes to extend class diagrams [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] to represent the
(mainly nested) structure of a log record.
      </p>
      <p>A log record is composed of attributes and eld sets, which group in their
turn attributes related to the same feature the eld set is representing. This
gives extensive and clear to any user representation with a possibility to
implement both top-down and bottom-up strategies on system development and/or
adjustments.</p>
      <p>
        Model Features The concepts of the class diagram model were taken as a basis
[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Added features and extensions provide the support for an ad-hoc
representation of log data. We explicitly highlight in the conceptual model that eld sets
and attributes partly coming from the ECS speci cation [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>Composition associations are used to represent a proper nesting, where the
nested parts may appear also within other parts, i.e., they are reusable. Field sets
are represented through a class-like shape, where we distinguish three di erent
sub-boxes, for core, extended and custom elds, respectively. An ad-hoc notation
is also introduced for local nesting of eld set. Other aspects considered in the
conceptual data model for log les are types for attributes, associations between
attributes, enumeration types, ECS metadata as categorization events, and an
array of values.</p>
      <p>For a demonstration, we show our extended diagram model obtained from the
common log le record. It helps understanding complex data transformations.
Fig. 1 shows a UML-based diagram for a single batch log of the custom
application in the banking domain created with the implementation of the proposed
conceptual model.</p>
      <p>It is fair to highlight that the application is in use and currently acquiring
log les are presented in text form, not structured accordingly, have numerous
issues and completely unsuitable for proper monitoring and especially analysis.
Applying our approach, together with an application owner, we succeeded to
design a set of suitable log les records for the batch processes.
3</p>
      <sec id="sec-4-1">
        <title>Towards the Implementation Process</title>
        <p>As for the usability of the conceptual approach, we started by considering some
real-world domains, from bank applications. Indeed, such kind of application
covers various general event logging.
3.1</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Python Script for ECS</title>
      <p>The raw data were taken from the ECS repository opened for contribution at
https://github.com/elastic/ecs. Originally ECS provides excessively many
elds for log records, and only a few of them are needed to be populated for a
certain case. Repository collects various les and tool templates, yet they do not
provide universal applicability to any system.</p>
      <p>We have chosen to maintain customizations by taking into consideration the
tools provided by ECS and creating our own generator (python script, input
and output les) to create relevant artefacts for the unique set of data sources.
The script is running through the command line. Here are the main steps of the
working process:
{ As an input le, the current version of the ECS log elds set in YAML format
is converted into JSON.
{ Users can select the log elds from the set and include custom elds relevant
to the project if it is needed.
{ As an output, the artifact in the format of JSON le is obtained; it represents
a sample template for a log record for the particular system.</p>
      <p>Notwithstanding that the script is still in active improvement, it is already
has been in use for several test cases of batch log les modelling. Fig. 2 provides
an example of the case used as well for the UML-based diagram demonstration.</p>
      <p>This script is a preliminary development for the future tool and has not been
published in open source yet. It is one of the parts with the following that must
relate to the UML-based graphical representation part.
3.2</p>
    </sec>
    <sec id="sec-6">
      <title>Further Steps on Tool Prototype Development</title>
      <p>At this point work not only propose the tool and step for its development but
provides preliminary solutions. All together the organizational ow and
conceptual model of possible architecture are showed on Fig. 3.</p>
      <p>The tool is aimed at artifacts creation: log les structural templates (in JSON
format according to de ned elds from the YAML doc) and related
documentation (which includes extended UML-based (class) diagrams).</p>
      <p>The tool is aimed to provide for the conceptual modelling of log les from
the beginning of system modelling or act as a supportive solution for rede ning
system logs. Yet in the second case, it is necessary to integrate loggers i.e. plugins
for the application (system) logging library to format logs into compatible JSON
format.
4</p>
      <sec id="sec-6-1">
        <title>Conclusion</title>
        <p>As the result, we provided a comprehensive overview of our work on log- les
modelling schema (in form of extended UML-based (class) diagrams) and
developed preliminary instruments (python script) for log le modelling in JSON
format (according to the prede ned structure). In addition, we demonstrated our
intention and actual steps for developing a comprehensive tool build based on the
proposed conceptual log le models, which will provide both ad hoc UML-based
diagrams as documentation and JSON formatted templates for log records.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Chuvakin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Phillips</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <article-title>"Logging and Log Management: The Authoritative Guide to Understanding the Concepts Surrounding Logging and Log Management"</article-title>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Nimbalkar</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mulwad</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Puranik</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Joshi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Finin</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <article-title>"Semantic Interpretation of Structured Log Files,"</article-title>
          <source>2016 IEEE 17th International Conference on Information Reuse and Integration (IRI)</source>
          ,
          <year>2016</year>
          , pp.
          <fpage>549</fpage>
          -
          <lpage>555</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Combi</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oliboni</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pozzi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sabaini</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Zimanyi</surname>
          </string-name>
          , E., \
          <article-title>Enabling instantand interval-based semantics in multidimensional data models: the T+MultiDim Model."</article-title>
          <source>Inf. Sci. 518</source>
          ,
          <year>2020</year>
          , pp.
          <fpage>413</fpage>
          -
          <lpage>435</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Zhang, H.,
          <string-name>
            <surname>Lou</surname>
            ,
            <given-names>J.-G.</given-names>
          </string-name>
          , Zhang,
          <string-name>
            <given-names>Y.</given-names>
            and
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <surname>X.</surname>
          </string-name>
          ,
          <article-title>"Log clustering based problem identi cation for online service systems"</article-title>
          ,
          <source>38th International Conference on Software Engineering Companion - ICSE'16</source>
          ,
          <string-name>
            <surname>Austin</surname>
          </string-name>
          , Texas,
          <year>2016</year>
          , pp.
          <volume>102</volume>
          {
          <fpage>111</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. OMG Uni ed
          <article-title>Modelling Language (OMG UML)</article-title>
          ,
          <source>version 2.5</source>
          .
          <issue>1</issue>
          ,
          <string-name>
            <surname>December</surname>
          </string-name>
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <article-title>"Elastic Common Schema (ECS) Reference [master]"</article-title>
          , [Online], Available: https://www.elastic.co/guide/en/ecs/master/ecs-custom
          <string-name>
            <surname>-</surname>
          </string-name>
          elds
          <string-name>
            <surname>-</surname>
          </string-name>
          in-ecs.html, [Accessed: 10 June 2021].
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Rakhmetova</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Combi</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Fruggi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <article-title>\A UML-based Approach to the Conceptual Modelling of Log Files"</article-title>
          ,
          <source>Technical Report</source>
          Department of Computer Science University of Verona,
          <year>2021</year>
          , in press.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>