Q: How to take map to particular element after map and split? Having the following snippet:
import std.algorithm;
import std.array : split;
import std.stdio;
import std.file;
import std.range;

void main(string[] args)
{
    string filename = "file.log";
    string term = "action";
    auto results = File(filename, "r")
                    .byLine
                    .filter!(a => canFind(a, term))
                    .map!(a => splitter(a, ":"));
                    // now how to take only first part of split? up to first ':'?

    foreach (line; results)
        writeln(line);
}

I am only interested in the first part after split operation (or some other operation that might be more efficient - just find first : and extract all characters up to it).
I tried something like:
.map!(a => a[0])

after split but I got an error
main.d(37): Error: no [] operator overload for type Result
/usr/include/dmd/phobos/std/algorithm/iteration.d(488):        instantiated from here: MapResult!(__lambda4, MapResult!(__lambda3, FilterResult!(__lambda2, ByLine!(char, char))))
main.d(37):        instantiated from here: map!(MapResult!(__lambda3, FilterResult!(__lambda2, ByLine!(char, char))))


A: You could use
std.algorithm.findSplitAfter:
    auto results = File(filename, "r")
                    .byLine
                    .filter!(a => canFind(a, term))
                    .map!(a => a.findSplitAfter(":")[1]);

Another option combines find to get you to the : and drop to get you past it:
auto results = File(filename, "r")
                .byLine
                .filter!(a => canFind(a, term))
                .map!(a => a.find(":").drop(1));


A: Use until.
.map!(a => a.until(':'));
group's default comparison is a == b, which does not work on lazy Untils. To use it with group, you need to pass a comparison that works, which would be equal:
    .map!(a => a.until(':'))
    .group!equal
    ...


A: It seems that I can also use splitter.front
auto results = File(filename, "r")
                .byLine
                .filter!(a => canFind(a, term))
                .map!(a => splitter(a, ":").front);

(any idea if there is something like indexing operator besides the front?)
