# Timelion code doesn't output graph, but line graph does!

**URL:** <https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [July 18, 2019, 3:08am UTC](https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118 "2019-07-18T03:08:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 18, 2019, 3:08am UTC](https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118/1 "2019-07-18T03:08:55Z")

</div>

**Question:**

How can I use Timelion visualization to show multiple line graphs at the same time?

**Timelion code:**

`.es(index=stage-api-athena*, timefield=capture_time, metric=sum:tomato_count, metric=count).range(min=0, max=1000)`

Note: I don't use Timestamp, I use capture\_time and upload\_time instead. Also, count is basically the same as row\_captured.

**My index mapping:**

```
{
  "stage-api-athena" : {
    "mappings" : {
      "properties" : {
        "@timestamp" : {
          "type" : "date"
        },
        "@version" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "capture_time" : {
          "type" : "date",
          "format" : "YYYY-MM-dd HH:mm:ss"
        },
        "color" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "customer_id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "customer_name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "direction" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "duration_hour" : {
          "type" : "long"
        },
        "farm_id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "farm_name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "firmware_version" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "hardware_version" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "is_customer_active" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "is_machine_active" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "machine_id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "machine_type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "phase_id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "phase_name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "phase_status" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "record_type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "row_captured" : {
          "type" : "long"
        },
        "row_number" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "row_session_id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "tomato_count" : {
          "type" : "long"
        },
        "type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "upload_time" : {
          "type" : "date",
          "format" : "YYYY-MM-dd HH:mm:ss"
        },
        "uuid" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "version" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        }
      }
    }
  }
}

```

**Kibana output after Timelion code:**

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2b4777243498fb281e879e1d08cb570affe84a26.png)

---

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 18, 2019, 6:03pm UTC](https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118/2 "2019-07-18T18:03:43Z")

</div>

Bump

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [July 18, 2019, 10:10pm UTC](https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118/3 "2019-07-18T22:10:38Z")

</div>

Can you try and make the interval of the search more exact? I think Timelion can be set to skip last bucket, maybe missing all your data. Also, could you show an example on how the data should look with a Line Graph from the kibana visualizations?

---

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 23, 2019, 5:50pm UTC](https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118/4 "2019-07-23T17:50:52Z")

</div>

I ended up using Timelion on a different index in a different example, but I will still share the code in case someone might use it.

```
.es(index=stage-cloudwatch*, q='cloudwatch_logs.log_group: "/aws/lambda/b2_raw_processor", message:"PROCESS-START"',metric=count, timefield=@timestamp).color(red).title(Invocations).label(b2_raw_processor), 
.es(index=stage-cloudwatch*,q='cloudwatch_logs.log_group: "/aws/lambda/b2_s3_writer", message:"PROCESS-START"',metric=count, timefield=@timestamp).color(green).title(Invocations).label(b2_s3_writer),
.es(index=stage-cloudwatch*,q='cloudwatch_logs.log_group: "/aws/lambda/b2_record_processor", message:"PROCESS-START"',metric=count, timefield=@timestamp).color(orange).title(Invocations).label(b2_record_processor),
.es(index=stage-cloudwatch*,q='cloudwatch_logs.log_group: "/aws/lambda/b2_fast_access_worker", message:"PROCESS-START"',metric=count, timefield=@timestamp).color(blue).title(Invocations).label(b2_fast_access_worker),
.es(index=stage-cloudwatch*,q='cloudwatch_logs.log_group: "/aws/lambda/b2_live_model_trigger", message:"PROCESS-START"',metric=count, timefield=@timestamp).color(purple).title(Invocations).label(b2_live_model_trigger),
.es(index=stage-cloudwatch*,q='cloudwatch_logs.log_group: "/aws/lambda/s_data_worker", message:"PROCESS-START"',metric=count, timefield=@timestamp).color(yellow).legend(columns=1, position=ne).title(Invocations).label(s_data_worker)

```

Index map:

```
{
  "stage-cloudwatch" : {
    "mappings" : {
      "properties" : {
        "@timestamp" : {
          "type" : "date"
        },
        "@version" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "cloudwatch_logs" : {
          "properties" : {
            "event_id" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "ingestion_time" : {
              "type" : "date"
            },
            "log_group" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "log_stream" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        },
        "message" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        }
      }
    }
  }
}

```

Note: This code is not for the example above!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 20, 2019, 6:02pm UTC](https://discuss.elastic.co/t/timelion-code-doesnt-output-graph-but-line-graph-does/191118/5 "2019-08-20T18:02:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
