Question: I have a module with a number of exported classes which all extend one base class. Each of these classes have a method called getOutput(). These classes match the structure of an API so I cant change it. The API returns a list and in that list can be any one of these classes (expect for the base class). I use the function to get a unified output no matter which type of object it is. The problem is, Typescript wont let you use the class function unless you assign the object to the class first. So in the base class I wrote a switch case to go through all the types and assign the object to a class. See here <https://stackblitz.com/edit/angular-nvxmqe-9kxr2k>

My problem is that using this approach means that the base class will have to know about each sub class. I would prefer that the subclass itself could assign its class based on the parameters in the class (the type parameter specifically). Or at the very least have another class do a dynamic lookup for the class based on the type. In Java I would use reflection to get a list of classes and assign them that way. I was wondering if there is something similar in Typescript. Or if there was a better way of doing this.

Again, the api is set, I cannot change it.

Answer: 
Are the log files generated by you? Or can you change the log structure? Then you can add a counter as a prefix and filter it out with logstash.

For example for

```
12345 2018-02-25 22:37:55 [mylibrary] INFO: this is an example log line

```

your filter must look like this:

```
filter {
   grok {
     match => {"message" => "%{INT:count} %{GREEDYDATA:message}"
     overwrite => ["message"]
   }
}

```

New field "count" will be created. You can then possibly use it for your purposes.
At this moment, I don't think there are any solutions here. Logstash, Beats, Kibana all have the idea of events over time and that's basically the way things are ordered. Line numbers are more of a text editor kind of functionality.

To a certain degree Kibana can show you the events in a file. It won't give you a page by page kind of list where you can actually click on a page number, but using time frames you could theoretically look at an entire file.

There are similar requests (enhancements) for [Beats](https://github.com/elastic/beats/issues/1037) and [Logstash](https://github.com/logstash-plugins/logstash-input-file/issues/7).