influxd generate help-schema

The influxd generate help-schema command outputs an example TOML schema to stdout that includes descriptions of available options. See example output below. Use custom TOML schema files to generate sample data sets with influxd generate.

Usage

  1. influxd generate help-schema [flags]

Flags

FlagDescriptionInput Type
—printPrint data spec and exit
—orgOrganization namestring
—bucketBucket namestring
—start-timeStart time (YYYY-MM-DDT00:00:00Z) (default is 00:00:00 of one week ago)string
—end-timeEnd time (YYYY-MM-DDT00:00:00Z) (default is 00:00:00 of current day)string
—cleanClean time series data files (none, tsm or all) (default none)string
—cpuprofileCollect a CPU profilestring
—memprofileCollect a memory profilestring
-h—helpHelp for the help-schema command

Example output

  1. title = "Documented schema"
  2. # limit the maximum number of series generated across all measurements
  3. #
  4. # series-limit: integer, optional (default: unlimited)
  5. [[measurements]]
  6. # name of measurement
  7. #
  8. # NOTE:
  9. # Multiple definitions of the same measurement name are allowed and
  10. # will be merged together.
  11. name = "cpu"
  12. # sample: float; where 0 < sample ≤ 1.0 (default: 0.5)
  13. # sample a subset of the tag set
  14. #
  15. # sample 25% of the tags
  16. #
  17. sample = 0.25
  18. # Keys for defining a tag
  19. #
  20. # name: string, required
  21. # Name of field
  22. #
  23. # source: array<string> or object
  24. #
  25. # A literal array of string values defines the tag values.
  26. #
  27. # An object defines more complex generators. The type key determines the
  28. # type of generator.
  29. #
  30. # source types:
  31. #
  32. # type: "sequence"
  33. # generate a sequence of tag values
  34. #
  35. # format: string
  36. # a format string for the values (default: "value%s")
  37. # start: int (default: 0)
  38. # beginning value
  39. # count: int, required
  40. # ending value
  41. #
  42. # type: "file"
  43. # generate a sequence of tag values from a file source.
  44. # The data in the file is sorted, deduplicated and verified is valid UTF-8
  45. #
  46. # path: string
  47. # absolute path or relative path to current toml file
  48. tags = [
  49. # example sequence tag source. The range of values are automatically
  50. # prefixed with 0s
  51. # to ensure correct sort behavior.
  52. { name = "host", source = { type = "sequence", format = "host-%s", start = 0, count = 5 } },
  53. # tags can also be sourced from a file. The path is relative to the
  54. # schema.toml.
  55. # Each value must be on a new line. The file is also sorted, deduplicated
  56. # and UTF-8 validated.
  57. { name = "rack", source = { type = "file", path = "files/racks.txt" } },
  58. # Example string array source, which is also deduplicated and sorted
  59. { name = "region", source = ["us-west-01","us-west-02","us-east"] },
  60. ]
  61. # Keys for defining a field
  62. #
  63. # name: string, required
  64. # Name of field
  65. #
  66. # count: int, required
  67. # The maximum number of values to generate. When multiple fields
  68. # have the same count and time-spec, they will share timestamps.
  69. #
  70. # A time-spec can be either time-precision or time-interval, which
  71. # determines how timestamps are generated and may also influence
  72. # the time range and number of values generated.
  73. #
  74. # time-precision: string [ns, us, ms, s, m, h] (default: ms)
  75. # Specifies the precision (rounding) for generated timestamps.
  76. #
  77. # If the precision results in fewer than "count" intervals for the
  78. # given time range, the number of values will be reduced.
  79. #
  80. # Example:
  81. # count = 1000, start = 0s, end = 100s, time-precison = s
  82. # 100 values will be generated at [0s, 1s, 2s, ..., 99s]
  83. #
  84. # If the precision results in greater than "count" intervals for the
  85. # given time range, the interval will be rounded to the nearest multiple of
  86. # time-precision.
  87. #
  88. # Example:
  89. # count = 10, start = 0s, end = 100s, time-precison = s
  90. # 100 values will be generated at [0s, 10s, 20s, ..., 90s]
  91. #
  92. # time-interval: Go duration string (eg 90s, 1h30m)
  93. # Specifies the delta between generated timestamps.
  94. #
  95. # If the delta results in fewer than "count" intervals for the
  96. # given time range, the number of values will be reduced.
  97. #
  98. # Example:
  99. # count = 100, start = 0s, end = 100s, time-interval = 10s
  100. # 10 values will be generated at [0s, 10s, 20s, ..., 90s]
  101. #
  102. # If the delta results in greater than "count" intervals for the
  103. # given time range, the start-time will be adjusted to ensure "count" values.
  104. #
  105. # Example:
  106. # count = 20, start = 0s, end = 1000s, time-interval = 10s
  107. # 20 values will be generated at [800s, 810s, ..., 900s, ..., 990s]
  108. #
  109. # source: int, float, boolean, string, array or object
  110. #
  111. # A literal int, float, boolean or string will produce
  112. # a constant value of the same data type.
  113. #
  114. # A literal array of homogeneous values will generate a repeating
  115. # sequence.
  116. #
  117. # An object defines more complex generators. The type key determines the
  118. # type of generator.
  119. #
  120. # source types:
  121. #
  122. # type: "rand<float>"
  123. # generate random float values
  124. # seed: seed to random number generator (default: 0)
  125. # min: minimum value (default: 0.0)
  126. # max: maximum value (default: 1.0)
  127. #
  128. # type: "zipf<integer>"
  129. # generate random integer values using a Zipf distribution
  130. # The generator generates values k ∈ [0, imax] such that P(k)
  131. # is proportional to (v + k) ** (-s). Requirements: s > 1 and v ≥ 1.
  132. # See https://golang.org/pkg/math/rand/#NewZipf for more information.
  133. #
  134. # seed: seed to random number generator (default: 0)
  135. # s: float > 1 (required)
  136. # v: float ≥ 1 (required)
  137. # imax: integer (required)
  138. #
  139. fields = [
  140. # Example constant float
  141. { name = "system", count = 5000, source = 2.5 },
  142. # Example random floats
  143. { name = "user", count = 5000, source = { type = "rand<float>", seed = 10, min = 0.0, max = 1.0 } },
  144. ]
  145. # Multiple measurements may be defined.
  146. [[measurements]]
  147. name = "mem"
  148. tags = [
  149. { name = "host", source = { type = "sequence", format = "host-%s", start = 0, count = 5 } },
  150. { name = "region", source = ["us-west-01","us-west-02","us-east"] },
  151. ]
  152. fields = [
  153. # An example of a sequence of integer values
  154. { name = "free", count = 100, source = [10,15,20,25,30,35,30], time-precision = "ms" },
  155. { name = "low_mem", count = 100, source = [false,true,true], time-precision = "ms" },
  156. ]

sample-data